(words: number[])
| 98 | |
| 99 | // Convert big-endian 32-bit words to a byte array |
| 100 | function wordsToBytes(words: number[]) { |
| 101 | const bytes = []; |
| 102 | for (let b = 0; b < words.length * 32; b += 8) bytes.push((words[b >>> 5] >>> (24 - (b % 32))) & 0xff); |
| 103 | return bytes; |
| 104 | } |
| 105 | |
| 106 | export function generateSHA1Hash(inputString: string): string { |
| 107 | const encoder = new TextEncoder(); |