ken_nogi/NodeJS/express/node_modules/uuid/dist/esm/md5.js
Kenichiro NOGI 51a95c5e21 NodeJS
2025-07-10 10:12:37 +09:00

12 lines
300 B
JavaScript

import { createHash } from 'crypto';
function md5(bytes) {
if (Array.isArray(bytes)) {
bytes = Buffer.from(bytes);
}
else if (typeof bytes === 'string') {
bytes = Buffer.from(bytes, 'utf8');
}
return createHash('md5').update(bytes).digest();
}
export default md5;