mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-09-07 18:40:48 +00:00
Redsign qortal-ui repo
This commit is contained in:
24
crypto/api/deps/Base64.js
Normal file
24
crypto/api/deps/Base64.js
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
const Base64 = {};
|
||||
|
||||
|
||||
|
||||
Base64.decode = function (string) {
|
||||
|
||||
const binaryString = atob(string);
|
||||
const binaryLength = binaryString.length;
|
||||
const bytes = new Uint8Array(binaryLength);
|
||||
|
||||
for (let i = 0; i < binaryLength; i++) {
|
||||
bytes[i] = binaryString.charCodeAt(i);
|
||||
}
|
||||
|
||||
const decoder = new TextDecoder();
|
||||
const decodedString = decoder.decode(bytes);
|
||||
return decodedString;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
export default Base64;
|
Reference in New Issue
Block a user