白宦成

Do things like hackers and try to make the world a better place

Node.js 计算字符串 Sha1


const crypto = require('crypto'),
      sha1 = crypto.createHash('sha1');
      sha1.update("Text");
      console.log(sha1.digest('hex'));
Code language: JavaScript (javascript)

你可以通过计算 Digest 来实现判断文字是否发生变化.


发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注