You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
301 B
18 lines
301 B
2 years ago
|
'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;
|