@retoken/crypter
v0.0.11
Published
Crypto-vector encryptor & decryptor
Downloads
3
Readme
@retoken/crypter
Thanks to Gauthier for the @rlvt/crypt package, on the basis of which this package was created
Install
$ npm i @retoken/crypter
Tests
$ npm test
Example
const crypter = require('@retoken/crypter')
const [TEXT, PASSWORD] = ['Aliase Network', 'Open Source Initiative <3 for everyone']
const encrypt = async (resolver) => {
await
crypter
.encrypt(TEXT, PASSWORD)
.then(resolver)
.catch(console.error)
}
const decrypt = async (resolver, KEY) => {
await
crypter
.decrypt(KEY, PASSWORD)
.then(resolver)
.catch(console.error)
}
encrypt(console.log) // ZmYyM2QwZWUwNDgyYzMzM2IzMTJhODFlNTVkMGM1MTA=
encrypt(key => {
decrypt(console.log, key) // Aliase Network
})