0.1.1 • Published 4 years ago

mercantil-crypto v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Mercantil API encryption module for Node.js

For Mercantil API integration, we recommend mercantil-api by the same people.

Highlights

Install

$ yarn add mercantil-crypto

Usage

import MercantilCrypto from 'mercantil-crypto';

const encryptionKey = process.env.MERCANTIL_ENCRYPTION_KEY as string;
const instance = new MercantilCrypto(encryptionKey);
const textToEncrypt = '1234';

const encrypted = instance.encrypt(textToEncrypt);
console.log(encrypted); // 'F5zai+S5sgmbdNPDEVRlVg=='

const decrypted = instance.decrypt(encrypted);
console.log(decrypted); // '1234'

Related

Maintainer

Miguel Padrino
Miguel Padrino

License

MIT © Miguel Padrino

0.1.1

4 years ago

0.1.0

4 years ago