mirror of
https://kevinblog.sytes.net/Code/Jibo-Revival-Group/JiboViteDocs.git
synced 2026-06-18 17:36:15 +00:00
Initalize
This commit is contained in:
20
node_modules/md5-hex/index.js
generated
vendored
Normal file
20
node_modules/md5-hex/index.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import crypto from 'node:crypto';
|
||||
|
||||
export default function md5Hex(data) {
|
||||
const hash = crypto.createHash('md5');
|
||||
|
||||
const update = buffer => {
|
||||
const inputEncoding = typeof buffer === 'string' ? 'utf8' : undefined;
|
||||
hash.update(buffer, inputEncoding);
|
||||
};
|
||||
|
||||
if (Array.isArray(data)) {
|
||||
for (const element of data) {
|
||||
update(element);
|
||||
}
|
||||
} else {
|
||||
update(data);
|
||||
}
|
||||
|
||||
return hash.digest('hex');
|
||||
}
|
||||
Reference in New Issue
Block a user