智能控制中心,出版发布

This commit is contained in:
BBIT-Kai
2025-05-09 18:07:26 +08:00
commit f6f2a71d09
1374 changed files with 116035 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import { createHash } from 'node:crypto';
/**
* 生产基于内容的 hash,可自定义长度
* @param content
* @param hashLSize
*/
function generatorContentHash(content: string, hashLSize?: number) {
const hash = createHash('md5').update(content, 'utf8').digest('hex');
if (hashLSize) {
return hash.slice(0, hashLSize);
}
return hash;
}
export { generatorContentHash };