qortal-ui/crypto/api/deps/Base64.js

19 lines
364 B
JavaScript
Raw Normal View History

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();
2024-03-29 09:00:10 +01:00
return decoder.decode(bytes);
};
2024-03-29 09:00:10 +01:00
export default Base64;