hexo/node_modules/hexo-util/lib/hash.js

18 lines
301 B
JavaScript
Raw Normal View History

2023-09-25 15:58:56 +08:00
'use strict';
const crypto = require('crypto');
const ALGORITHM = 'sha1';
function createSha1Hash() {
return crypto.createHash(ALGORITHM);
}
exports.hash = content => {
const hash = createSha1Hash();
hash.update(content);
return hash.digest();
};
exports.createSha1Hash = createSha1Hash;