main
js 11 lines 402 Bytes
Raw
1 export {}
2 // this is the minimum required for lib tssrp6a to work
3 window.crypto ||= {}
4 crypto.subtle ||= console.debug("using polyfill for crypto.subtle") || {}
5 crypto.subtle.digest ||= async (algo, buff) => {
6 if (algo !== 'SHA-512')
7 return alert(algo + ' required but not supported')
8 const lib = await import('js-sha512')
9 const sha = lib.default.arrayBuffer
10 return sha(buff)
11 }