@retoken/salter
v0.0.2
Published
Crypto-vector-salt encryptor & decryptor
Downloads
2
Readme
@retoken/salter
Install
$ npm i @retoken/salter
Tests
$ npm test
Example
const salter = require('@retoken/salter')
const [
TEXT,
PASSWORD,
SALTDEEP,
] = [
'Aliase Network',
'Open Source Initiative <3 for everyone',
4 // 1 === @retoken/crypter mode
]
const encrypt = async (resolver) => {
await
salter
.encrypt(TEXT, PASSWORD, SALTDEEP)
.then(resolver)
.catch(console.error)
}
const decrypt = async (resolver, KEY) => {
await
salter
.decrypt(KEY, PASSWORD)
.then(resolver)
.catch(console.error)
}
encrypt(console.log) // Encoded
encrypt(key => {
decrypt(console.log, key) // Aliase Network
})