class Hash {
static encode(content) {
return btoa(unescape(encodeURIComponent(content)));
}
static decode(content) {
return decodeURIComponent(escape(atob(content)));
}
}
const encode = Hash.encode(JSON.stringify([6, 1.5, 23, 34, 'зелёный']));
console.log(encode);
const decode = Hash.decode(encode);
console.log(JSON.parse(decode));