hash.ts 240 B

12345678
  1. import { createHash } from 'node:crypto';
  2. function createContentHash(content: string, hashLSize = 12) {
  3. const hash = createHash('sha256').update(content);
  4. return hash.digest('hex').slice(0, hashLSize);
  5. }
  6. export { createContentHash };