0.0.11 • Published 5 years ago

@retoken/crypter v0.0.11

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

@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
})

crypter.encrypt(TEXT, PASSWORD)

crypter.decrypt(TEXT, PASSWORD)