switch receiving chat message to base64 and added qortal:// protocol to be recognized as links in the chat

This commit is contained in:
2023-04-29 05:47:30 +03:00
parent 2e15d5015e
commit 595d16af86
7 changed files with 253 additions and 54 deletions

View 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;