(str: string)
| 29 | * @returns Hexadecimal representation of the hash. |
| 30 | */ |
| 31 | const getHexSha256 = async (str: string): Promise<string> => { |
| 32 | const data = stringToBuffer(str); |
| 33 | const hashBuffer = await crypto.subtle.digest('SHA-256', data); |
| 34 | const hashHex = ByteUtils.toHex(new Uint8Array(hashBuffer)); |
| 35 | return hashHex; |
| 36 | }; |
| 37 | |
| 38 | /** |
| 39 | * Calculates the HMAC-SHA256 of a string using the provided key. |
no test coverage detected