Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 563 Bytes

File metadata and controls

17 lines (12 loc) · 563 Bytes
description Native Node.js alternatives to the md5 package for MD5 hash generation

Replacements for md5

crypto (native)

If you're using the md5 package, consider using a stronger algorithm where possible. If you must keep MD5 for compatibility, Node.js provides a native alternative via the crypto module.

import crypto from 'node:crypto' // [!code ++]
import md5 from 'md5' // [!code --]

md5('message') // [!code --]
crypto.createHash('md5').update('message').digest('hex') // [!code ++]