vue-vben-admin/internal/vite-config/src/utils/hash.ts

9 lines
240 B
TypeScript
Raw Normal View History

2023-04-05 00:20:48 +08:00
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 };