fix: ensure correct input type for SHA-256 hashing in tests

This commit is contained in:
alam00000 committed 2026-03-27 13:47:08 +05:30
1 parent 86c8086979
commit dd36fdde7a
1 file changed
+4 -1
+4 -1
View File
@@ -19,7 +19,10 @@ const SAMPLE_PDF_SHA256 =
'229defbb0cee6f02673a5cde290d0673e75a0dc31cec43989c8ab2a4eca7e1bb'; '229defbb0cee6f02673a5cde290d0673e75a0dc31cec43989c8ab2a4eca7e1bb';
async function sha256(data: Uint8Array): Promise<string> { async function sha256(data: Uint8Array): Promise<string> {
const hashBuffer = await crypto.subtle.digest('SHA-256', data); const hashBuffer = await crypto.subtle.digest(
'SHA-256',
new Uint8Array(data)
);
return Array.from(new Uint8Array(hashBuffer)) return Array.from(new Uint8Array(hashBuffer))
.map((b) => b.toString(16).padStart(2, '0')) .map((b) => b.toString(16).padStart(2, '0'))
.join(''); .join('');