npm.io
0.1.2 • Published 9 years ago

node-ts-crypto-promise

Licence
MIT
Version
0.1.2
Deps
1
Vulns
0
Weekly
0

#node-ts-crypto-promise

安装

npm install node-ts-crypto-promise

使用方法

使用Promise
import {Crypto} from "node-ts-crypto-promise"

let data = Crypto.hash('1234567980', 'SHA256').toString('hex');
// data === c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646
使用async/await
import {Crypto} from "node-ts-crypto-promise"

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

APIS:

目前只实现了以下API:

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

Keywords