a6a85147d6cfa6d5c27a7109d3cab669538e36e8f34da21f7a687860a2a7e0d3f53620e373fc3c4b3182051af6ca9e3e940cb09f2b272ec2b37fa68878147f 281 B

12345678910111213
  1. import crypto from 'crypto';
  2. function md5(bytes) {
  3. if (Array.isArray(bytes)) {
  4. bytes = Buffer.from(bytes);
  5. } else if (typeof bytes === 'string') {
  6. bytes = Buffer.from(bytes, 'utf8');
  7. }
  8. return crypto.createHash('md5').update(bytes).digest();
  9. }
  10. export default md5;