Skip to content

Yoyo MD5 implementation. Compatible with server-side environments like node.js, module loaders like RequireJS and all web browsers.

License

Notifications You must be signed in to change notification settings

kvba5/Yoyo-MD5

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JavaScript MD5

Contents

Description

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.

Usage

Client-side

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>"

Server-side

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"

Requirements

The JavaScript MD5 script has zero dependencies.

API

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)

Tests

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.

License

The Yoyo MD5 script is released under the MIT license just like it's original project.

About

Yoyo MD5 implementation. Compatible with server-side environments like node.js, module loaders like RequireJS and all web browsers.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 50.0%
  • HTML 31.2%
  • CSS 18.8%