📜  加密模块 - CSS 代码示例

📅  最后修改于: 2022-03-11 14:47:36.588000             🧑  作者: Mango

代码示例1
const { createHmac } = await import('crypto');

const secret = 'abcdefg';
const hash = createHmac('sha256', secret)
               .update('I love cupcakes')
               .digest('hex');
console.log(hash);
// Prints:
//   c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e