mirror of
https://github.com/emn178/js-md5.git
synced 2026-08-12 20:31:43 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ecaeee185 | ||
|
|
daf1188dc6 | ||
|
|
a9de3df8c6 | ||
|
|
08049ec6fa |
@@ -1,5 +1,14 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## v0.8.2 / 2023-10-09
|
||||||
|
### Remove
|
||||||
|
- package.json module property.
|
||||||
|
|
||||||
|
## v0.8.1 / 2023-10-09
|
||||||
|
### Added
|
||||||
|
- TypeScript base64 interfaces.
|
||||||
|
- Disable webpack polyfill.
|
||||||
|
|
||||||
## v0.8.0 / 2023-09-27
|
## v0.8.0 / 2023-09-27
|
||||||
### Added
|
### Added
|
||||||
- TypeScript interfaces.
|
- TypeScript interfaces.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
[](https://coveralls.io/r/emn178/js-md5?branch=master)
|
[](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.
|
A simple and fast MD5 hash function for JavaScript supports UTF-8 encoding.
|
||||||
|
|
||||||
## Demo
|
## Demo
|
||||||
[MD5 Online](http://emn178.github.io/online-tools/md5.html)
|
[MD5 Online](http://emn178.github.io/online-tools/md5.html)
|
||||||
@@ -13,6 +13,10 @@ A simple MD5 hash function for JavaScript supports UTF-8 encoding.
|
|||||||
[Compress](https://raw.github.com/emn178/js-md5/master/build/md5.min.js)
|
[Compress](https://raw.github.com/emn178/js-md5/master/build/md5.min.js)
|
||||||
[Uncompress](https://raw.github.com/emn178/js-md5/master/src/md5.js)
|
[Uncompress](https://raw.github.com/emn178/js-md5/master/src/md5.js)
|
||||||
|
|
||||||
|
## Benchmark
|
||||||
|
[jsPerf Benchmark](https://jsperf.app/jonuhi)
|
||||||
|
[File Benchmark](https://github.com/emn178/js-md5/issues/19)
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
You can also install js-md5 by using Bower.
|
You can also install js-md5 by using Bower.
|
||||||
|
|
||||||
@@ -47,6 +51,12 @@ If you use node.js, you should require the module first:
|
|||||||
var md5 = require('js-md5');
|
var md5 = require('js-md5');
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### TypeScript
|
||||||
|
If you use TypeScript, you can import like this:
|
||||||
|
```TypeScript
|
||||||
|
import { md5 } from 'js-md5';
|
||||||
|
```
|
||||||
|
|
||||||
## RequireJS
|
## RequireJS
|
||||||
It supports AMD:
|
It supports AMD:
|
||||||
```JavaScript
|
```JavaScript
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "js-md5",
|
"name": "js-md5",
|
||||||
"version": "0.8.0",
|
"version": "0.8.2",
|
||||||
"main": ["src/md5.js"],
|
"main": ["src/md5.js"],
|
||||||
"ignore": [
|
"ignore": [
|
||||||
"tests"
|
"tests"
|
||||||
|
|||||||
Vendored
+20
@@ -32,6 +32,11 @@ interface Hasher {
|
|||||||
* Return hash in integer array.
|
* Return hash in integer array.
|
||||||
*/
|
*/
|
||||||
array(): number[];
|
array(): number[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return hash in base64 string.
|
||||||
|
*/
|
||||||
|
base64(): string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Hmac {
|
interface Hmac {
|
||||||
@@ -89,6 +94,14 @@ interface Hmac {
|
|||||||
* @param message The message you want to hash.
|
* @param message The message you want to hash.
|
||||||
*/
|
*/
|
||||||
array(secretKey: Message, message: Message): number[];
|
array(secretKey: Message, message: Message): number[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return hash in base64 string.
|
||||||
|
*
|
||||||
|
* @param secretKey The Secret Key
|
||||||
|
* @param message The message you want to hash.
|
||||||
|
*/
|
||||||
|
base64(secretKey: Message, message: Message): string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Hash {
|
interface Hash {
|
||||||
@@ -139,6 +152,13 @@ interface Hash {
|
|||||||
*/
|
*/
|
||||||
array(message: Message): number[];
|
array(message: Message): number[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return hash in base64 string.
|
||||||
|
*
|
||||||
|
* @param message The message you want to hash.
|
||||||
|
*/
|
||||||
|
base64(message: Message): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HMAC interface
|
* HMAC interface
|
||||||
*/
|
*/
|
||||||
|
|||||||
+6
-2
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "js-md5",
|
"name": "js-md5",
|
||||||
"version": "0.8.0",
|
"version": "0.8.2",
|
||||||
"description": "A simple MD5 hash function for JavaScript supports UTF-8 encoding.",
|
"description": "A simple MD5 hash function for JavaScript supports UTF-8 encoding.",
|
||||||
"main": "src/md5.js",
|
"main": "build/md5.min.js",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"expect.js": "~0.3.1",
|
"expect.js": "~0.3.1",
|
||||||
"jsdoc": "~4.0.2",
|
"jsdoc": "~4.0.2",
|
||||||
@@ -41,5 +41,9 @@
|
|||||||
"exclude": [
|
"exclude": [
|
||||||
"tests"
|
"tests"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"browser": {
|
||||||
|
"crypto": false,
|
||||||
|
"buffer": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
* [js-md5]{@link https://github.com/emn178/js-md5}
|
* [js-md5]{@link https://github.com/emn178/js-md5}
|
||||||
*
|
*
|
||||||
* @namespace md5
|
* @namespace md5
|
||||||
* @version 0.8.0
|
* @version 0.8.2
|
||||||
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
||||||
* @copyright Chen, Yi-Cyuan 2014-2023
|
* @copyright Chen, Yi-Cyuan 2014-2023
|
||||||
* @license MIT
|
* @license MIT
|
||||||
|
|||||||
Reference in New Issue
Block a user