mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-09-08 02:50:38 +00:00
switch receiving chat message to base64 and added qortal:// protocol to be recognized as links in the chat
This commit is contained in:
24
qortal-ui-crypto/api/deps/Base64.js
Normal file
24
qortal-ui-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