Skip to content

Commit 7bb11b6

Browse files
committed
refactor: always use crypto.hash
ref vitejs/vite-plugin-vue@5de85f6
1 parent e396f10 commit 7bb11b6

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/core/utils/descriptorCache.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,6 @@ export function setSrcDescriptor(
150150
cache.set(filename, entry)
151151
}
152152

153-
const hash =
154-
crypto.hash ??
155-
((
156-
algorithm: string,
157-
data: crypto.BinaryLike,
158-
outputEncoding: crypto.BinaryToTextEncoding,
159-
) => crypto.createHash(algorithm).update(data).digest(outputEncoding))
160-
161153
function getHash(text: string): string {
162-
return hash('sha256', text, 'hex').slice(0, 8)
154+
return crypto.hash('sha256', text, 'hex').slice(0, 8)
163155
}

0 commit comments

Comments
 (0)