(value: string)
| 1151 | |
| 1152 | describe('generateHash', () => { |
| 1153 | async function computeNativeSha256(value: string): Promise<string> { |
| 1154 | const msgUint8 = new TextEncoder().encode(value); |
| 1155 | const hashBuffer = await crypto.subtle.digest('SHA-256', msgUint8); |
| 1156 | const hashArray = Array.from(new Uint8Array(hashBuffer)); |
| 1157 | return hashArray.map((b) => b.toString(16).padStart(2, '0')).join(''); |
| 1158 | } |
| 1159 | |
| 1160 | it('should generate standard SHA-256 hashes matching Web Crypto specs', async () => { |
| 1161 | const testCases = [ |
no test coverage detected