|
|
@ -9,5 +9,7 @@ sha2.sum = function (alg, str) { |
|
|
|
data = encoder.encode(str); |
|
|
|
} |
|
|
|
var sha = 'SHA-' + String(alg).replace(/^sha-?/i, ''); |
|
|
|
return window.crypto.subtle.digest(sha, data); |
|
|
|
return window.crypto.subtle.digest(sha, data).then(function (buf) { |
|
|
|
return new Uint8Array(buf); |
|
|
|
}); |
|
|
|
}; |
|
|
|