UNPKG
@voya-kit/vite-config
Version:
latest (0.0.13)
0.0.13
0.0.12
0.0.11
0.0.10
0.0.9
0.0.8
0.0.7
Voya vite config
@voya-kit/vite-config
/
src
/
utils
/
hash.ts
9 lines
(6 loc)
•
240 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
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 };