mirror of https://github.com/qortal/qortal-ui
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
393 B
23 lines
393 B
|
|
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(); |
|
return decoder.decode(bytes); |
|
}; |
|
|
|
|
|
|
|
|
|
export default Base64;
|
|
|