mirror of
https://github.com/valentineus/iii-client.git
synced 2025-06-06 07:23:35 +03:00
Refusal to support older versions of NodeJS
This commit is contained in:
parent
37c1348382
commit
3eff453aac
@ -4,8 +4,6 @@ node_js:
|
|||||||
- "8"
|
- "8"
|
||||||
- "7"
|
- "7"
|
||||||
- "6"
|
- "6"
|
||||||
- "5"
|
|
||||||
- "4"
|
|
||||||
|
|
||||||
os:
|
os:
|
||||||
- linux
|
- linux
|
||||||
@ -20,7 +18,6 @@ before_install:
|
|||||||
- npm install --global codacy-coverage
|
- npm install --global codacy-coverage
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- npm install --only=production
|
|
||||||
- npm install --only=development
|
- npm install --only=development
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
10
src/index.js
10
src/index.js
@ -76,8 +76,8 @@ function send(cuid, text, callback) {
|
|||||||
* @description Encrypts the received string.
|
* @description Encrypts the received string.
|
||||||
*/
|
*/
|
||||||
function encrypt(data) {
|
function encrypt(data) {
|
||||||
var base64 = new Buffer(data).toString('base64');
|
var base64 = Buffer.from(data).toString('base64');
|
||||||
var string = new Buffer(base64);
|
var string = Buffer.from(base64);
|
||||||
return mergerString(string).toString('base64');
|
return mergerString(string).toString('base64');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,9 +87,9 @@ function encrypt(data) {
|
|||||||
* @description Decrypts the received string.
|
* @description Decrypts the received string.
|
||||||
*/
|
*/
|
||||||
function decrypt(data) {
|
function decrypt(data) {
|
||||||
var string = new Buffer(data, 'base64');
|
var string = Buffer.from(data, 'base64');
|
||||||
var decrypted = mergerString(string).toString();
|
var decrypted = mergerString(string).toString();
|
||||||
return new Buffer(decrypted, 'base64');
|
return Buffer.from(decrypted, 'base64');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -109,7 +109,7 @@ function decryptJSON(json) {
|
|||||||
* @description Merges the source string.
|
* @description Merges the source string.
|
||||||
*/
|
*/
|
||||||
function mergerString(data) {
|
function mergerString(data) {
|
||||||
var salt = new Buffer('some very-very long string without any non-latin characters due to different string representations inside of variable programming languages');
|
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 data.map((item, index) => {
|
||||||
return item ^ salt[index % salt.length];
|
return item ^ salt[index % salt.length];
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user