0.1.2 • Published 7 years ago

node-ts-crypto-promise v0.1.2

Weekly downloads
3
License
MIT
Repository
-
Last release
7 years ago

#node-ts-crypto-promise

Installation

npm install node-ts-crypto-promise

Usage

Using promise

import {Crypto} from "node-ts-crypto-promise"

let data = Crypto.hash('1234567980', 'SHA256').toString('hex');
// data === c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646

Using async/await

import {Crypto} from "node-ts-crypto-promise"

async function someFunction() {
    let data = await Crypto.hash('1234567980', 'SHA256').toString('hex');
    // data === c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646}
}

APIS:

Only following API is implemented currently:

  • Crypto.hash
  • Crypto.hmac
  • Crypto.randomBytes
  • Crypto.ciphers
  • Crypto.hashes