mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
11 lines
246 B
JavaScript
11 lines
246 B
JavaScript
const crypto = require('crypto');
|
|
/**
|
|
* @param {any} content
|
|
* @return {string}
|
|
*/
|
|
global.Hydro.lib.sha1 = module.exports = (content) => {
|
|
const hash = crypto.createHash('sha1');
|
|
hash.update(content);
|
|
return hash.digest('hex');
|
|
};
|