Ben Lin
2024-06-11 f47146fbfa96b71f0b47f2c3a55a9d20a8eea1cb
1
2
3
4
5
6
7
8
import { createHash } from 'node:crypto';
 
function createContentHash(content: string, hashLSize = 12) {
  const hash = createHash('sha256').update(content);
  return hash.digest('hex').slice(0, hashLSize);
}
 
export { createContentHash };