* Removed length detection in node.js.

* Deprecated `buffer` and replace by `arrayBuffer`.
This commit is contained in:
Yi-Cyuan
2016-03-31 16:25:38 +08:00
parent 261e55bd5c
commit 5fcee84417
15 changed files with 435 additions and 447 deletions
+9 -4
View File
@@ -1,12 +1,13 @@
# js-md5
[![Build Status](https://travis-ci.org/emn178/js-md5.svg?branch=master)](https://travis-ci.org/emn178/js-md5)
[![Coverage Status](https://coveralls.io/repos/emn178/js-md5/badge.svg?branch=master)](https://coveralls.io/r/emn178/js-md5?branch=master)
[![NPM](https://nodei.co/npm/js-md5.png?stars&downloads)](https://nodei.co/npm/js-md5/)
[![NPM](https://nodei.co/npm/js-md5.png?stars&downloads)](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)