Yoyo MD5 implementation.
Compatible with server-side environments like Node.js,
module loaders like RequireJS or
webpack and all web browsers.
This fork is modified version of MD5 used by Yoyo for hashing GM runners.
Install the package with NPM:
# npm
npm install https://github.com/kvba5/Yoyo-MD5
# pnpm
pnpm install https://github.com/kvba5/Yoyo-MD5
# bun
bun add https://github.com/kvba5/Yoyo-MD5
Include the (minified) JavaScript MD5 script in your JS code:
import { yoyomd5 } from "js/md5.min.js"
In your application code, calculate the (hex-encoded) MD5 hash of a string by calling the yoyomd5 method with the string as argument:
const hash = yoyomd5('string') // "<yoyo-md5 byte string>"
The following is an example how to use the JavaScript MD5 module on the server-side with Node.js.
Install the package with NPM:
# npm
npm install https://github.com/kvba5/Yoyo-MD5
# pnpm
pnpm install https://github.com/kvba5/Yoyo-MD5
# bun
bun add https://github.com/kvba5/Yoyo-MD5
Import module using the following code:
import { yoyomd5 } from "yoyo-md5"
The JavaScript MD5 script has zero dependencies.
This fork has been stripped from any other API that Javascript-MD5 used. Instead there's only one exposed function yoyomd5
for generating byte string of the value you provide.
const hash = yoyomd5('string') // "<yoyo-md5 byte string>"
You can of course then base64 it by using:
// node.js
const base64hash = hash.toString("base64")
// browser
const base64hash = btoa(hash)
All original tests of Javascript-MD5 have been replaced with ones that are needed for proper generation of Yoyo MD5 hashing. For original tests please visit original source code.
The Yoyo MD5 script is released under the MIT license just like it's original project.