Files
dax-pay-ui/internal/node-utils/src/hash.ts
bootx 63da01e68e feat: 升级到 Vben Admin v5 架构 (daxpay-ui v4.0.0)
- 从 daxpay4/daxpay4-web 同步 Vben Admin v5 版本代码
- 移除代理商模块(前端页面、API、国际化、权限码)
- 清理商户页面中代理商相关引用
2026-06-12 21:42:51 +08:00

19 lines
394 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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 };