summaryrefslogtreecommitdiff
path: root/ext/crypto/00_crypto.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/crypto/00_crypto.js')
-rw-r--r--ext/crypto/00_crypto.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/crypto/00_crypto.js b/ext/crypto/00_crypto.js
index 5eb283b22..50ee9a7db 100644
--- a/ext/crypto/00_crypto.js
+++ b/ext/crypto/00_crypto.js
@@ -24,6 +24,7 @@
StringPrototypeToUpperCase,
StringPrototypeReplace,
StringPrototypeCharCodeAt,
+ StringFromCharCode,
Symbol,
SymbolFor,
SymbolToStringTag,
@@ -140,9 +141,11 @@
}
function unpaddedBase64(bytes) {
- const binaryString = core.decode(bytes);
+ let binaryString = "";
+ for (let i = 0; i < bytes.length; i++) {
+ binaryString += StringFromCharCode(bytes[i]);
+ }
const base64String = btoa(binaryString);
-
return StringPrototypeReplace(base64String, /=/g, "");
}