https://github.com/beyondjs/md5
A fast and efficient MD5 hash implementation for JavaScript, compatible with both Node.js and browser environments. This lightweight package provides a simple API for generating MD5 hashes from strings, with optimizations for performance including pre-computed lookup tables and efficient bitwise operations.
https://github.com/beyondjs/md5
Last synced: 4 months ago
JSON representation
A fast and efficient MD5 hash implementation for JavaScript, compatible with both Node.js and browser environments. This lightweight package provides a simple API for generating MD5 hashes from strings, with optimizations for performance including pre-computed lookup tables and efficient bitwise operations.
- Host: GitHub
- URL: https://github.com/beyondjs/md5
- Owner: beyondjs
- License: mit
- Created: 2022-12-01T13:32:38.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-13T23:03:17.000Z (almost 2 years ago)
- Last Synced: 2025-10-09T07:33:30.686Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @beyond-js/md5
A fast and efficient MD5 hash implementation for JavaScript, compatible with both Node.js and browser environments.
## Installation
```bash
npm install @beyond-js/md5
```
## Usage
```javascript
const md5 = require('@beyond-js/md5');
const hash = md5('Hello, World!');
console.log(hash); // Outputs: 65a8e27d8879283831b664bd8b7f0ad4
```
## API
The module exports a single function:
```javascript
function md5(str: string): string
```
- `str`: The input string to be hashed.
- Returns: A lowercase string representing the MD5 hash of the input.
## Features
- Fast and efficient MD5 implementation
- Works with strings as input
- Returns lowercase MD5 hash
- No external dependencies
- Compatible with Node.js and browser environments
## Implementation Details
This MD5 implementation is based on the RSA Data Security, Inc. MD5 Message-Digest Algorithm. It includes optimizations
for performance, such as:
- Pre-computed lookup tables
- Bitwise operations for speed
- Efficient word array conversion
## License
MIT © [[BeyondJS](https://beyondjs.com)]