Encryption in nodejs

烂漫一生 提交于 2019-12-04 02:33:18
Tesserex

You want to use the createHmac function instead.

Crypto.createHmac("SHA256", 'secret').update('string').digest('base64')

The method is called createHmac

> Crypto = require('crypto');
{ Credentials: [Function: Credentials],
  createCredentials: [Function],
  Hash: [Function],
  createHash: [Function],
  Hmac: [Function],
  createHmac: [Function],
  Cipher: [Function],
  createCipher: [Function],
  createCipheriv: [Function],
  Decipher: [Function],
  createDecipher: [Function],
  createDecipheriv: [Function],
  Sign: [Function],
  createSign: [Function],
  Verify: [Function],
  createVerify: [Function],
  DiffieHellman: [Function],
  createDiffieHellman: [Function],
  pbkdf2: [Function],
  randomBytes: [Function],
  pseudoRandomBytes: [Function],
  rng: [Function],
  prng: [Function] }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!