Exciting news!Announcing our $4.6M Series Seed. Learn more
Socket
LoveBlogFAQ
Install
Log in

stream-md5

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Issues
File Explorer

Advanced tools

stream-md5

MD5 implementation in JS that allows progressive hashing and is binary safe

    0.0.2latest

Version published
Maintainers
1
Yearly downloads
8,760
decreased by-76.32%

Weekly downloads

Readme

Source

Allows you to stream md5 data and hash at the very end which is very efficient when working with files. This file is based off Joseph Myers' version found at http://www.myersdaily.org/joseph/javascript/md5-text.html.

The progressive portion is based off PHP's implementation. See http://php.net/manual/en/function.hash-init.php

Notes

  • If you pass an array, we look at the first element to determine if its an array of characters or of bytes.
  • Buffers are assumed to contain bytes.
  • You cannot mix types in a progressive state. (This will be fixed in a later version)

Examples

//to hash a single string var hash = StreamMD5.hash("test") //098f6bcd4621d373cade4e832627b4f6 //for streaming data var state = StreamMD5.init(); while (something) { StreamMD5.update(state, string); } var hash = StreamMD5.finalize(state);

Todo

  • Support streams

Keywords

Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc