(value: string)
| 1364 | |
| 1365 | describe('generateHash', () => { |
| 1366 | async function computeNativeSha256(value: string): Promise<string> { |
| 1367 | const msgUint8 = new TextEncoder().encode(value); |
| 1368 | const hashBuffer = await crypto.subtle.digest('SHA-256', msgUint8); |
| 1369 | const hashArray = Array.from(new Uint8Array(hashBuffer)); |
| 1370 | return hashArray.map((b) => b.toString(16).padStart(2, '0')).join(''); |
| 1371 | } |
| 1372 | |
| 1373 | it('should generate standard SHA-256 hashes matching Web Crypto specs', async () => { |
| 1374 | const testCases = [ |
no test coverage detected