0
mirror of https://github.com/valentineus/iii-client.git synced 2025-07-01 10:30:27 +03:00

Small code refactoring to support older platforms

This commit is contained in:
2017-10-09 19:00:02 +04:00
parent 79243accc5
commit cc2c50b07b
2 changed files with 7 additions and 8 deletions

View File

@ -1,4 +1,3 @@
import { Buffer } from 'safe-buffer';
import http from 'http';
/**
@ -111,9 +110,12 @@ function decryptJSON(json) {
*/
function mergerString(data) {
var salt = Buffer.from('some very-very long string without any non-latin characters due to different string representations inside of variable programming languages');
return data.map((item, index) => {
return item ^ salt[index % salt.length];
});
for (var i = 0; i < data.length; i++) {
data[i] ^= salt[i % salt.length];
}
return data;
}
/**