Работа над ServerStorage

This commit is contained in:
Book Pauk
2019-03-13 20:22:04 +07:00
parent 6904cfd224
commit cd5d3903fe
3 changed files with 68 additions and 37 deletions

View File

@@ -63,4 +63,8 @@ export async function aesDecrypt(data, password) {
key, //from generateKey or importKey above
data //ArrayBuffer of the data
);
}
}
export async function sha256(data) {
return await crypto.subtle.digest("SHA-256", Buffer.from(data));
}

View File

@@ -78,7 +78,7 @@ export async function copyTextToClipboard(text) {
}
export function toBase58(data) {
return bs58.encode(data);
return bs58.encode(Buffer.from(data));
}
export function fromBase58(data) {
@@ -86,7 +86,7 @@ export function fromBase58(data) {
}
export function toBase64(data) {
return bs64.encode(data);
return bs64.encode(Buffer.from(data));
}
export function fromBase64(data) {