收藏主机.

This commit is contained in:
lijiahang
2023-09-14 16:18:41 +08:00
parent 08f9b9410b
commit f8b694c16a
13 changed files with 386 additions and 74 deletions

View File

@@ -50,6 +50,17 @@ export function md5(plain: string): string {
return Md5.hashStr(plain);
}
/**
* 获取数据颜色
*/
export function dataColor(str: string, colors: string[]): string {
let total = 0;
for (let i = 0; i < str.length; i++) {
total += str.charCodeAt(i);
}
return colors[total % colors.length];
}
/**
* 判断值是否非空
*/