bugfix: sha2 must return Uint8Array, not ArrayBuffer

Cette révision appartient à :
AJ ONeal 2020-08-20 01:02:18 -06:00
Parent c66e9267aa
révision af7ee5426f
1 fichiers modifiés avec 3 ajouts et 1 suppressions

Voir le fichier

@ -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);
});
};