Package Exports
- node-crypto
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-crypto) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Crypto
以nodejs官方crypto加密模块为核心
Install
npm i node-crypto --saveUsage
var Crypto = require('node-crypto')
var cp = new Crypto('you secret code')
var base64 = cp.base('123456')
console.log(base64)
// =>
// 2VyW6u0OSBYr5VIYRhJ5FXLOtec=
var hex = cp.hex('123456')
console.log(hex)
// =>
// d95c96eaed0e48162be552184612791572ceb5e7
console.log( cp.baseToHex('2VyW6u0OSBYr5VIYRhJ5FXLOtec=') )
// =>
// d95c96eaed0e48162be552184612791572ceb5e7
console.log( cp.hexToBase('d95c96eaed0e48162be552184612791572ceb5e7') )
// =>
// 2VyW6u0OSBYr5VIYRhJ5FXLOtec=