pi-miner-ios/Utils.js
2021-04-15 15:52:54 +07:00

22 lines
497 B
JavaScript

const Buffer = require('buffer/').Buffer;
const decryptor = (raw) => {
const buf = new Buffer.from(raw, 'base64');
const encrypted = buf.toString('utf8').split('').map((c) => {
return c.charCodeAt(0)
})
const key = "sksaj897&*&*klwefdn16".split('').map((c) => {
return c.charCodeAt(0)
})
const decrypted = encrypted.map((c, i) => {
const k = key[i % key.length]
return String.fromCharCode(c ^ k)
}).join('')
return JSON.parse(decrypted)
}
export {
decryptor
}