@retoken/crypter

0.0.11 • Public • Published

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

Package Sidebar

Install

npm i @retoken/crypter

Weekly Downloads

1

Version

0.0.11

License

MIT

Unpacked Size

6.19 kB

Total Files

10

Last publish

Collaborators

  • murka