mirror of
https://github.com/emn178/js-md5.git
synced 2026-08-12 20:31:43 +08:00
* Removed length detection in node.js.
* Deprecated `buffer` and replace by `arrayBuffer`.
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
# js-md5
|
||||
[](https://travis-ci.org/emn178/js-md5)
|
||||
[](https://coveralls.io/r/emn178/js-md5?branch=master)
|
||||
[](https://nodei.co/npm/js-md5/)
|
||||
[](https://nodei.co/npm/js-md5/)
|
||||
|
||||
A simple MD5 hash function for JavaScript supports UTF-8 encoding.
|
||||
|
||||
## Demo
|
||||
[MD5 Online](http://emn178.github.io/online-tools/md5.html)
|
||||
[MD5 File Checksum Online](http://emn178.github.io/online-tools/md5_checksum.html)
|
||||
[MD5 File Checksum Online](http://emn178.github.io/online-tools/md5_checksum.html)
|
||||
|
||||
## Download
|
||||
[Compress](https://raw.github.com/emn178/js-md5/master/build/md5.min.js)
|
||||
@@ -21,6 +22,9 @@ For node.js, you can use this command to install:
|
||||
|
||||
npm install js-md5
|
||||
|
||||
## Notice
|
||||
`buffer` method is deprecated. This maybe confuse with Buffer in node.js. Please use `arrayBuffer` instead.
|
||||
|
||||
## Usage
|
||||
You could use like this:
|
||||
```JavaScript
|
||||
@@ -59,7 +63,8 @@ md5(''); // d41d8cd98f00b204e9800998ecf8427e
|
||||
md5.hex(''); // d41d8cd98f00b204e9800998ecf8427e
|
||||
md5.array(''); // [212, 29, 140, 217, 143, 0, 178, 4, 233, 128, 9, 152, 236, 248, 66, 126]
|
||||
md5.digest(''); // [212, 29, 140, 217, 143, 0, 178, 4, 233, 128, 9, 152, 236, 248, 66, 126]
|
||||
md5.buffer(''); // ArrayBuffer
|
||||
md5.arrayBuffer(''); // ArrayBuffer
|
||||
md5.buffer(''); // ArrayBuffer, deprecated, This maybe confuse with Buffer in node.js. Please use arrayBuffer instead.
|
||||
```
|
||||
|
||||
## Benchmark
|
||||
@@ -71,4 +76,4 @@ The project is released under the [MIT license](http://www.opensource.org/licens
|
||||
|
||||
## Contact
|
||||
The project's website is located at https://github.com/emn178/js-md5
|
||||
Author: Yi-Cyuan Chen (emn178@gmail.com)
|
||||
Author: Chen, Yi-Cyuan (emn178@gmail.com)
|
||||
|
||||
Reference in New Issue
Block a user