perf: 流水线同一个阶段任务优化为并行执行

This commit is contained in:
xiaojunnuo
2025-03-11 00:46:03 +08:00
parent fc8bef5aae
commit efa9c748c5
4 changed files with 56 additions and 15 deletions

View File

@@ -1,10 +1,10 @@
import crypto from 'crypto';
import crypto, { BinaryToTextEncoding } from 'crypto';
function md5(data: string) {
return crypto.createHash('md5').update(data).digest('hex');
function md5(data: string, digest: BinaryToTextEncoding = 'hex') {
return crypto.createHash('md5').update(data).digest(digest);
}
function sha256(data: string) {
return crypto.createHash('sha256').update(data).digest('hex');
function sha256(data: string, digest: BinaryToTextEncoding = 'hex') {
return crypto.createHash('sha256').update(data).digest(digest);
}
function base64(data: string) {