Compare commits

..
Author SHA1 Message Date
Yi-Cyuan ChenandClaude Opus 5.5 66db5dbd99 ### Fixed
- Incorrect hash for `DataView` input.
- Throws `ArrayBuffer is not defined` in browsers without `ArrayBuffer`.

### Changed
- Multi-byte typed arrays such as `Uint16Array`, `Uint32Array` and `Float32Array` are now hashed by their underlying bytes, the same as Node.js `crypto` and Web Crypto. Previously each element was treated as one byte.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 13:31:55 +08:00
Yi-Cyuan ChenandClaude Opus 5.5 c2a7870840 ### Changed
- Clarify the benchmark summary in the README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 15:14:32 +08:00
Yi-Cyuan ChenandClaude Opus 5.5 698e7154d2 update README badges
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 17:01:17 +08:00
Yi-Cyuan ChenandClaude Opus 5.5 2bf0dfe852 ### Changed
- Update transitive dev dependencies to fix security advisories (brace-expansion, browserslist, diff, glob, js-yaml, markdown-it, minimatch, serialize-javascript)
- Drop Node.js 16 from CI

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 16:48:47 +08:00
emn178andGitHub 43adee1975 Merge pull request #56 from emn178/dependabot/npm_and_yarn/markdown-it-14.3.3
Bump markdown-it from 14.3.0 to 14.3.3
2026-11-16 16:40:40 +08:00
emn178andGitHub 6fcf6a9639 Merge pull request #55 from emn178/dependabot/npm_and_yarn/multi-581aeff57e
Bump brace-expansion
2026-11-16 16:40:28 +08:00
emn178andGitHub 34f76ca8f2 Merge pull request #53 from emn178/dependabot/npm_and_yarn/multi-c5ebbb4833
Bump js-yaml
2026-11-16 16:40:17 +08:00
emn178andGitHub 5a922fe1d6 Merge pull request #51 from emn178/dependabot/npm_and_yarn/browserslist-4.28.9
Bump browserslist from 4.28.6 to 4.28.9
2026-11-16 16:38:49 +08:00
Yi-Cyuan ChenandClaude Opus 5.5 68b5c32442 ### Fixed
- Unpaired UTF-16 surrogates produce wrong digests and consume the next code unit in the JS path. Unpaired surrogates are now encoded as U+FFFD, matching `TextEncoder` and Node.js `crypto`. #57

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 16:37:59 +08:00
dependabot[bot]andGitHub f44a93667b Bump brace-expansion
Bumps  and [brace-expansion](https://github.com/juliangruber/brace-expansion). These dependencies needed to be updated together.

Updates `brace-expansion` from 2.1.2 to 2.1.7
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/v2.1.2...v2.1.7)

Updates `brace-expansion` from 5.0.7 to 5.0.12
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/v2.1.2...v2.1.7)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 2.1.7
  dependency-type: indirect
- dependency-name: brace-expansion
  dependency-version: 5.0.12
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-12 19:28:48 +00:00
dependabot[bot]andGitHub 906ee91381 Bump js-yaml
Bumps  and [js-yaml](https://github.com/nodeca/js-yaml). These dependencies needed to be updated together.

Updates `js-yaml` from 4.3.0 to 4.3.2
- [Changelog](https://github.com/nodeca/js-yaml/blob/4.3.2/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/4.3.0...4.3.2)

Updates `js-yaml` from 3.15.0 to 3.15.2
- [Changelog](https://github.com/nodeca/js-yaml/blob/4.3.2/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/4.3.0...4.3.2)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 4.3.2
  dependency-type: indirect
- dependency-name: js-yaml
  dependency-version: 3.15.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-13 15:30:19 +00:00
dependabot[bot]andGitHub e55d53a634 Bump browserslist from 4.28.6 to 4.28.9
Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.28.6 to 4.28.9.
- [Release notes](https://github.com/browserslist/browserslist/releases)
- [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/browserslist/browserslist/compare/4.28.6...4.28.9)

---
updated-dependencies:
- dependency-name: browserslist
  dependency-version: 4.28.9
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-07 15:37:09 +00:00
33 changed files with 518 additions and 812 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x, 22.x, 24.x]
node-version: [18.x, 20.x, 22.x, 24.x]
steps:
- name: Checkout code
uses: actions/checkout@v4
+16
View File
@@ -1,5 +1,21 @@
# Change Log
## v0.11.0 / 2026-11-18
### Fixed
- Incorrect hash for `DataView` input.
- Throws `ArrayBuffer is not defined` in browsers without `ArrayBuffer`.
### Changed
- Multi-byte typed arrays such as `Uint16Array`, `Uint32Array` and `Float32Array` are now hashed by their underlying bytes, the same as Node.js `crypto` and Web Crypto. Previously each element was treated as one byte.
## v0.10.0 / 2026-11-16
### Fixed
- Unpaired UTF-16 surrogates produce wrong digests and consume the next code unit in the JS path. Unpaired surrogates are now encoded as U+FFFD, matching `TextEncoder` and Node.js `crypto`. #57
### Changed
- Update transitive dev dependencies to fix security advisories (brace-expansion, browserslist, diff, glob, js-yaml, markdown-it, minimatch, serialize-javascript)
- Drop Node.js 16 from CI
## v0.9.2 / 2026-07-20
### Fixed
- CI test.
+5 -4
View File
@@ -1,7 +1,8 @@
# js-md5
[![CI](https://github.com/emn178/js-md5/actions/workflows/ci.yml/badge.svg)](https://github.com/emn178/js-md5/actions/workflows/ci.yml)
[![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/)
[![Coverage Status](https://coveralls.io/repos/emn178/js-md5/badge.svg?branch=master)](https://coveralls.io/r/emn178/js-md5?branch=master)
[![NPM](https://img.shields.io/npm/v/js-md5)](https://www.npmjs.com/package/js-md5)
[![CDNJS](https://img.shields.io/jsdelivr/npm/hm/js-md5)](https://www.jsdelivr.com/package/npm/js-md5)
A simple and fast MD5 hash function for JavaScript supports UTF-8 encoding.
@@ -39,7 +40,7 @@ APIs, including `hex`, `array`, `digest`, and `arrayBuffer` output.
- [Async Benchmark (measurethat.net)](https://measurethat.net/Benchmarks/Show/29176/0/md5-performance-comparison-very-long-text-v6)
- [Async Benchmark (jsperf.app)](https://jsperf.app/jonuhi/9)
* js-md5 is the fastest synchronous MD5 library, but slower than Hash-WASM
* js-md5 is the fastest for short strings in these benchmarks. For large data, WebAssembly-based libraries (e.g. Hash-WASM) are faster.
- [File Benchmark - Issue #19](https://github.com/emn178/js-md5/issues/19)
- [File Benchmark - Issue #42](https://github.com/emn178/js-md5/issues/42)
@@ -102,7 +103,7 @@ md5('The quick brown fox jumps over the lazy dog.'); // e4d909c290d0fb1ca068ffad
// It also supports UTF-8 encoding
md5('中文'); // a7bac2239fcdcb3a067903d8077c4a07
// It also supports byte `Array`, `Uint8Array`, `ArrayBuffer`
// It also supports byte `Array`, `Uint8Array`, `ArrayBuffer` and other `ArrayBuffer` views (their underlying bytes are hashed)
md5([]); // d41d8cd98f00b204e9800998ecf8427e
md5(new Uint8Array([])); // d41d8cd98f00b204e9800998ecf8427e
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "js-md5",
"version": "0.9.2",
"version": "0.11.0",
"main": ["src/md5.js"],
"ignore": [
"tests"
+19 -7
View File
@@ -2,7 +2,7 @@
* [js-md5]{@link https://github.com/emn178/js-md5}
*
* @namespace md5
* @version 0.9.2
* @version 0.11.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2026
* @license MIT
@@ -39,7 +39,7 @@
var isArray = Array.isArray;
var isView = ArrayBuffer.isView;
var isView = ArrayBuffer.isView ;
// [message: string, isString: bool]
var formatMessage = function (message) {
@@ -53,10 +53,14 @@
if (message.constructor === ArrayBuffer) {
return [new Uint8Array(message), false];
}
if (!isArray(message) && !isView(message)) {
if (isArray(message)) {
return [message, false];
}
if (!isView(message)) {
throw new Error(INPUT_ERROR);
}
return [message, false];
// read the underlying bytes of any view (DataView, Uint16Array, ...)
return [new Uint8Array(message.buffer, message.byteOffset, message.byteLength), false];
};
/**
@@ -172,6 +176,8 @@
throw new Error(INPUT_ERROR);
} else if (message.constructor === ArrayBuffer) {
message = new Uint8Array(message);
} else if (isView(message) && message.constructor !== Buffer) {
message = new Uint8Array(message.buffer, message.byteOffset, message.byteLength);
}
}
if (isArray(message) || isView(message) ||
@@ -227,7 +233,7 @@
var result = formatMessage(message);
message = result[0];
var isString = result[1];
var code, index = 0, i, length = message.length, blocks = this.blocks;
var code, code2, index = 0, i, length = message.length, blocks = this.blocks;
var buffer8 = this.buffer8;
while (index < length) {
@@ -253,12 +259,18 @@
buffer8[i++] = 0xe0 | (code >>> 12);
buffer8[i++] = 0x80 | ((code >>> 6) & 0x3f);
buffer8[i++] = 0x80 | (code & 0x3f);
} else {
code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
} else if (code < 0xdc00 && (code2 = message.charCodeAt(index + 1)) >= 0xdc00 && code2 < 0xe000) {
++index;
code = 0x10000 + (((code & 0x3ff) << 10) | (code2 & 0x3ff));
buffer8[i++] = 0xf0 | (code >>> 18);
buffer8[i++] = 0x80 | ((code >>> 12) & 0x3f);
buffer8[i++] = 0x80 | ((code >>> 6) & 0x3f);
buffer8[i++] = 0x80 | (code & 0x3f);
} else {
// unpaired surrogate: U+FFFD
buffer8[i++] = 0xef;
buffer8[i++] = 0xbf;
buffer8[i++] = 0xbd;
}
}
}
+2 -2
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+17 -7
View File
@@ -8,7 +8,7 @@ var md5$1 = {exports: {}};
* [js-md5]{@link https://github.com/emn178/js-md5}
*
* @namespace md5
* @version 0.9.2
* @version 0.11.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2026
* @license MIT
@@ -42,7 +42,7 @@ var md5$1 = {exports: {}};
var isArray = Array.isArray;
var isView = ArrayBuffer.isView;
var isView = ArrayBuffer.isView ;
// [message: string, isString: bool]
var formatMessage = function (message) {
@@ -56,10 +56,14 @@ var md5$1 = {exports: {}};
if (message.constructor === ArrayBuffer) {
return [new Uint8Array(message), false];
}
if (!isArray(message) && !isView(message)) {
if (isArray(message)) {
return [message, false];
}
if (!isView(message)) {
throw new Error(INPUT_ERROR);
}
return [message, false];
// read the underlying bytes of any view (DataView, Uint16Array, ...)
return [new Uint8Array(message.buffer, message.byteOffset, message.byteLength), false];
};
/**
@@ -203,7 +207,7 @@ var md5$1 = {exports: {}};
var result = formatMessage(message);
message = result[0];
var isString = result[1];
var code, index = 0, i, length = message.length, blocks = this.blocks;
var code, code2, index = 0, i, length = message.length, blocks = this.blocks;
var buffer8 = this.buffer8;
while (index < length) {
@@ -229,12 +233,18 @@ var md5$1 = {exports: {}};
buffer8[i++] = 0xe0 | (code >>> 12);
buffer8[i++] = 0x80 | ((code >>> 6) & 0x3f);
buffer8[i++] = 0x80 | (code & 0x3f);
} else {
code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
} else if (code < 0xdc00 && (code2 = message.charCodeAt(index + 1)) >= 0xdc00 && code2 < 0xe000) {
++index;
code = 0x10000 + (((code & 0x3ff) << 10) | (code2 & 0x3ff));
buffer8[i++] = 0xf0 | (code >>> 18);
buffer8[i++] = 0x80 | ((code >>> 12) & 0x3f);
buffer8[i++] = 0x80 | ((code >>> 6) & 0x3f);
buffer8[i++] = 0x80 | (code & 0x3f);
} else {
// unpaired surrogate: U+FFFD
buffer8[i++] = 0xef;
buffer8[i++] = 0xbf;
buffer8[i++] = 0xbd;
}
}
}
+19 -7
View File
@@ -13,7 +13,7 @@ var md5$1 = {exports: {}};
* [js-md5]{@link https://github.com/emn178/js-md5}
*
* @namespace md5
* @version 0.9.2
* @version 0.11.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2026
* @license MIT
@@ -51,7 +51,7 @@ var md5$1 = {exports: {}};
var isArray = Array.isArray;
var isView = ArrayBuffer.isView;
var isView = ArrayBuffer.isView ;
// [message: string, isString: bool]
var formatMessage = function (message) {
@@ -65,10 +65,14 @@ var md5$1 = {exports: {}};
if (message.constructor === ArrayBuffer) {
return [new Uint8Array(message), false];
}
if (!isArray(message) && !isView(message)) {
if (isArray(message)) {
return [message, false];
}
if (!isView(message)) {
throw new Error(INPUT_ERROR);
}
return [message, false];
// read the underlying bytes of any view (DataView, Uint16Array, ...)
return [new Uint8Array(message.buffer, message.byteOffset, message.byteLength), false];
};
/**
@@ -184,6 +188,8 @@ var md5$1 = {exports: {}};
throw new Error(INPUT_ERROR);
} else if (message.constructor === ArrayBuffer) {
message = new Uint8Array(message);
} else if (isView(message) && message.constructor !== Buffer) {
message = new Uint8Array(message.buffer, message.byteOffset, message.byteLength);
}
}
if (isArray(message) || isView(message) ||
@@ -239,7 +245,7 @@ var md5$1 = {exports: {}};
var result = formatMessage(message);
message = result[0];
var isString = result[1];
var code, index = 0, i, length = message.length, blocks = this.blocks;
var code, code2, index = 0, i, length = message.length, blocks = this.blocks;
var buffer8 = this.buffer8;
while (index < length) {
@@ -265,12 +271,18 @@ var md5$1 = {exports: {}};
buffer8[i++] = 0xe0 | (code >>> 12);
buffer8[i++] = 0x80 | ((code >>> 6) & 0x3f);
buffer8[i++] = 0x80 | (code & 0x3f);
} else {
code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
} else if (code < 0xdc00 && (code2 = message.charCodeAt(index + 1)) >= 0xdc00 && code2 < 0xe000) {
++index;
code = 0x10000 + (((code & 0x3ff) << 10) | (code2 & 0x3ff));
buffer8[i++] = 0xf0 | (code >>> 18);
buffer8[i++] = 0x80 | ((code >>> 12) & 0x3f);
buffer8[i++] = 0x80 | ((code >>> 6) & 0x3f);
buffer8[i++] = 0x80 | (code & 0x3f);
} else {
// unpaired surrogate: U+FFFD
buffer8[i++] = 0xef;
buffer8[i++] = 0xbf;
buffer8[i++] = 0xbd;
}
}
}
+36 -12
View File
@@ -2,7 +2,7 @@
* [js-md5]{@link https://github.com/emn178/js-md5}
*
* @namespace md5
* @version 0.9.2
* @version 0.11.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2026
* @license MIT
@@ -58,7 +58,7 @@
};
}
var isView = ArrayBuffer.isView;
var isView = ARRAY_BUFFER ? ArrayBuffer.isView : null;
/* istanbul ignore else */
if (ARRAY_BUFFER && (root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW || !isView)) {
isView = function (obj) {
@@ -78,10 +78,14 @@
if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {
return [new Uint8Array(message), false];
}
if (!isArray(message) && !isView(message)) {
if (isArray(message)) {
return [message, false];
}
if (!ARRAY_BUFFER || !isView(message)) {
throw new Error(INPUT_ERROR);
}
return [message, false];
// read the underlying bytes of any view (DataView, Uint16Array, ...)
return [new Uint8Array(message.buffer, message.byteOffset, message.byteLength), false];
};
/**
@@ -202,6 +206,8 @@
throw new Error(INPUT_ERROR);
} else if (message.constructor === ArrayBuffer) {
message = new Uint8Array(message);
} else if (ARRAY_BUFFER && isView(message) && message.constructor !== Buffer) {
message = new Uint8Array(message.buffer, message.byteOffset, message.byteLength);
}
}
if (isArray(message) || isView(message) ||
@@ -369,7 +375,7 @@
var result = formatMessage(message);
message = result[0];
var isString = result[1];
var code, index = 0, i, length = message.length, blocks = this.blocks;
var code, code2, index = 0, i, length = message.length, blocks = this.blocks;
var buffer8 = this.buffer8;
while (index < length) {
@@ -395,12 +401,18 @@
buffer8[i++] = 0xe0 | (code >>> 12);
buffer8[i++] = 0x80 | ((code >>> 6) & 0x3f);
buffer8[i++] = 0x80 | (code & 0x3f);
} else {
code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
} else if (code < 0xdc00 && (code2 = message.charCodeAt(index + 1)) >= 0xdc00 && code2 < 0xe000) {
++index;
code = 0x10000 + (((code & 0x3ff) << 10) | (code2 & 0x3ff));
buffer8[i++] = 0xf0 | (code >>> 18);
buffer8[i++] = 0x80 | ((code >>> 12) & 0x3f);
buffer8[i++] = 0x80 | ((code >>> 6) & 0x3f);
buffer8[i++] = 0x80 | (code & 0x3f);
} else {
// unpaired surrogate: U+FFFD
buffer8[i++] = 0xef;
buffer8[i++] = 0xbf;
buffer8[i++] = 0xbd;
}
}
} else {
@@ -415,12 +427,18 @@
blocks[i >>> 2] |= (0xe0 | (code >>> 12)) << SHIFT[i++ & 3];
blocks[i >>> 2] |= (0x80 | ((code >>> 6) & 0x3f)) << SHIFT[i++ & 3];
blocks[i >>> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
} else {
code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
} else if (code < 0xdc00 && (code2 = message.charCodeAt(index + 1)) >= 0xdc00 && code2 < 0xe000) {
++index;
code = 0x10000 + (((code & 0x3ff) << 10) | (code2 & 0x3ff));
blocks[i >>> 2] |= (0xf0 | (code >>> 18)) << SHIFT[i++ & 3];
blocks[i >>> 2] |= (0x80 | ((code >>> 12) & 0x3f)) << SHIFT[i++ & 3];
blocks[i >>> 2] |= (0x80 | ((code >>> 6) & 0x3f)) << SHIFT[i++ & 3];
blocks[i >>> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
} else {
// unpaired surrogate: U+FFFD
blocks[i >>> 2] |= 0xef << SHIFT[i++ & 3];
blocks[i >>> 2] |= 0xbf << SHIFT[i++ & 3];
blocks[i >>> 2] |= 0xbd << SHIFT[i++ & 3];
}
}
}
@@ -803,7 +821,7 @@
var i, result = formatMessage(key);
key = result[0];
if (result[1]) {
var bytes = [], length = key.length, index = 0, code;
var bytes = [], length = key.length, index = 0, code, code2;
for (i = 0; i < length; ++i) {
code = key.charCodeAt(i);
if (code < 0x80) {
@@ -815,12 +833,18 @@
bytes[index++] = (0xe0 | (code >>> 12));
bytes[index++] = (0x80 | ((code >>> 6) & 0x3f));
bytes[index++] = (0x80 | (code & 0x3f));
} else {
code = 0x10000 + (((code & 0x3ff) << 10) | (key.charCodeAt(++i) & 0x3ff));
} else if (code < 0xdc00 && (code2 = key.charCodeAt(i + 1)) >= 0xdc00 && code2 < 0xe000) {
++i;
code = 0x10000 + (((code & 0x3ff) << 10) | (code2 & 0x3ff));
bytes[index++] = (0xf0 | (code >>> 18));
bytes[index++] = (0x80 | ((code >>> 12) & 0x3f));
bytes[index++] = (0x80 | ((code >>> 6) & 0x3f));
bytes[index++] = (0x80 | (code & 0x3f));
} else {
// unpaired surrogate: U+FFFD
bytes[index++] = 0xef;
bytes[index++] = 0xbf;
bytes[index++] = 0xbd;
}
}
key = bytes;
+2 -2
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
File diff suppressed because one or more lines are too long
+34 -12
View File
@@ -8,7 +8,7 @@ var md5$1 = {exports: {}};
* [js-md5]{@link https://github.com/emn178/js-md5}
*
* @namespace md5
* @version 0.9.2
* @version 0.11.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2026
* @license MIT
@@ -61,7 +61,7 @@ var md5$1 = {exports: {}};
};
}
var isView = ArrayBuffer.isView;
var isView = ARRAY_BUFFER ? ArrayBuffer.isView : null;
/* istanbul ignore else */
if (ARRAY_BUFFER && (root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW || !isView)) {
isView = function (obj) {
@@ -81,10 +81,14 @@ var md5$1 = {exports: {}};
if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {
return [new Uint8Array(message), false];
}
if (!isArray(message) && !isView(message)) {
if (isArray(message)) {
return [message, false];
}
if (!ARRAY_BUFFER || !isView(message)) {
throw new Error(INPUT_ERROR);
}
return [message, false];
// read the underlying bytes of any view (DataView, Uint16Array, ...)
return [new Uint8Array(message.buffer, message.byteOffset, message.byteLength), false];
};
/**
@@ -340,7 +344,7 @@ var md5$1 = {exports: {}};
var result = formatMessage(message);
message = result[0];
var isString = result[1];
var code, index = 0, i, length = message.length, blocks = this.blocks;
var code, code2, index = 0, i, length = message.length, blocks = this.blocks;
var buffer8 = this.buffer8;
while (index < length) {
@@ -366,12 +370,18 @@ var md5$1 = {exports: {}};
buffer8[i++] = 0xe0 | (code >>> 12);
buffer8[i++] = 0x80 | ((code >>> 6) & 0x3f);
buffer8[i++] = 0x80 | (code & 0x3f);
} else {
code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
} else if (code < 0xdc00 && (code2 = message.charCodeAt(index + 1)) >= 0xdc00 && code2 < 0xe000) {
++index;
code = 0x10000 + (((code & 0x3ff) << 10) | (code2 & 0x3ff));
buffer8[i++] = 0xf0 | (code >>> 18);
buffer8[i++] = 0x80 | ((code >>> 12) & 0x3f);
buffer8[i++] = 0x80 | ((code >>> 6) & 0x3f);
buffer8[i++] = 0x80 | (code & 0x3f);
} else {
// unpaired surrogate: U+FFFD
buffer8[i++] = 0xef;
buffer8[i++] = 0xbf;
buffer8[i++] = 0xbd;
}
}
} else {
@@ -386,12 +396,18 @@ var md5$1 = {exports: {}};
blocks[i >>> 2] |= (0xe0 | (code >>> 12)) << SHIFT[i++ & 3];
blocks[i >>> 2] |= (0x80 | ((code >>> 6) & 0x3f)) << SHIFT[i++ & 3];
blocks[i >>> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
} else {
code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
} else if (code < 0xdc00 && (code2 = message.charCodeAt(index + 1)) >= 0xdc00 && code2 < 0xe000) {
++index;
code = 0x10000 + (((code & 0x3ff) << 10) | (code2 & 0x3ff));
blocks[i >>> 2] |= (0xf0 | (code >>> 18)) << SHIFT[i++ & 3];
blocks[i >>> 2] |= (0x80 | ((code >>> 12) & 0x3f)) << SHIFT[i++ & 3];
blocks[i >>> 2] |= (0x80 | ((code >>> 6) & 0x3f)) << SHIFT[i++ & 3];
blocks[i >>> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
} else {
// unpaired surrogate: U+FFFD
blocks[i >>> 2] |= 0xef << SHIFT[i++ & 3];
blocks[i >>> 2] |= 0xbf << SHIFT[i++ & 3];
blocks[i >>> 2] |= 0xbd << SHIFT[i++ & 3];
}
}
}
@@ -774,7 +790,7 @@ var md5$1 = {exports: {}};
var i, result = formatMessage(key);
key = result[0];
if (result[1]) {
var bytes = [], length = key.length, index = 0, code;
var bytes = [], length = key.length, index = 0, code, code2;
for (i = 0; i < length; ++i) {
code = key.charCodeAt(i);
if (code < 0x80) {
@@ -786,12 +802,18 @@ var md5$1 = {exports: {}};
bytes[index++] = (0xe0 | (code >>> 12));
bytes[index++] = (0x80 | ((code >>> 6) & 0x3f));
bytes[index++] = (0x80 | (code & 0x3f));
} else {
code = 0x10000 + (((code & 0x3ff) << 10) | (key.charCodeAt(++i) & 0x3ff));
} else if (code < 0xdc00 && (code2 = key.charCodeAt(i + 1)) >= 0xdc00 && code2 < 0xe000) {
++i;
code = 0x10000 + (((code & 0x3ff) << 10) | (code2 & 0x3ff));
bytes[index++] = (0xf0 | (code >>> 18));
bytes[index++] = (0x80 | ((code >>> 12) & 0x3f));
bytes[index++] = (0x80 | ((code >>> 6) & 0x3f));
bytes[index++] = (0x80 | (code & 0x3f));
} else {
// unpaired surrogate: U+FFFD
bytes[index++] = 0xef;
bytes[index++] = 0xbf;
bytes[index++] = 0xbd;
}
}
key = bytes;
+28 -10
View File
@@ -2,7 +2,7 @@
* [js-md5]{@link https://github.com/emn178/js-md5}
*
* @namespace md5
* @version 0.9.2
* @version 0.11.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2026
* @license MIT
@@ -49,7 +49,7 @@
var isArray = Array.isArray;
var isView = ArrayBuffer.isView;
var isView = ArrayBuffer.isView ;
// [message: string, isString: bool]
var formatMessage = function (message) {
@@ -63,10 +63,14 @@
if (message.constructor === ArrayBuffer) {
return [new Uint8Array(message), false];
}
if (!isArray(message) && !isView(message)) {
if (isArray(message)) {
return [message, false];
}
if (!isView(message)) {
throw new Error(INPUT_ERROR);
}
return [message, false];
// read the underlying bytes of any view (DataView, Uint16Array, ...)
return [new Uint8Array(message.buffer, message.byteOffset, message.byteLength), false];
};
/**
@@ -182,6 +186,8 @@
throw new Error(INPUT_ERROR);
} else if (message.constructor === ArrayBuffer) {
message = new Uint8Array(message);
} else if (isView(message) && message.constructor !== Buffer) {
message = new Uint8Array(message.buffer, message.byteOffset, message.byteLength);
}
}
if (isArray(message) || isView(message) ||
@@ -347,7 +353,7 @@
var result = formatMessage(message);
message = result[0];
var isString = result[1];
var code, index = 0, i, length = message.length, blocks = this.blocks;
var code, code2, index = 0, i, length = message.length, blocks = this.blocks;
var buffer8 = this.buffer8;
while (index < length) {
@@ -373,12 +379,18 @@
buffer8[i++] = 0xe0 | (code >>> 12);
buffer8[i++] = 0x80 | ((code >>> 6) & 0x3f);
buffer8[i++] = 0x80 | (code & 0x3f);
} else {
code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
} else if (code < 0xdc00 && (code2 = message.charCodeAt(index + 1)) >= 0xdc00 && code2 < 0xe000) {
++index;
code = 0x10000 + (((code & 0x3ff) << 10) | (code2 & 0x3ff));
buffer8[i++] = 0xf0 | (code >>> 18);
buffer8[i++] = 0x80 | ((code >>> 12) & 0x3f);
buffer8[i++] = 0x80 | ((code >>> 6) & 0x3f);
buffer8[i++] = 0x80 | (code & 0x3f);
} else {
// unpaired surrogate: U+FFFD
buffer8[i++] = 0xef;
buffer8[i++] = 0xbf;
buffer8[i++] = 0xbd;
}
}
}
@@ -757,7 +769,7 @@
var i, result = formatMessage(key);
key = result[0];
if (result[1]) {
var bytes = [], length = key.length, index = 0, code;
var bytes = [], length = key.length, index = 0, code, code2;
for (i = 0; i < length; ++i) {
code = key.charCodeAt(i);
if (code < 0x80) {
@@ -769,12 +781,18 @@
bytes[index++] = (0xe0 | (code >>> 12));
bytes[index++] = (0x80 | ((code >>> 6) & 0x3f));
bytes[index++] = (0x80 | (code & 0x3f));
} else {
code = 0x10000 + (((code & 0x3ff) << 10) | (key.charCodeAt(++i) & 0x3ff));
} else if (code < 0xdc00 && (code2 = key.charCodeAt(i + 1)) >= 0xdc00 && code2 < 0xe000) {
++i;
code = 0x10000 + (((code & 0x3ff) << 10) | (code2 & 0x3ff));
bytes[index++] = (0xf0 | (code >>> 18));
bytes[index++] = (0x80 | ((code >>> 12) & 0x3f));
bytes[index++] = (0x80 | ((code >>> 6) & 0x3f));
bytes[index++] = (0x80 | (code & 0x3f));
} else {
// unpaired surrogate: U+FFFD
bytes[index++] = 0xef;
bytes[index++] = 0xbf;
bytes[index++] = 0xbd;
}
}
key = bytes;
+2 -2
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+26 -10
View File
@@ -8,7 +8,7 @@ var md5$1 = {exports: {}};
* [js-md5]{@link https://github.com/emn178/js-md5}
*
* @namespace md5
* @version 0.9.2
* @version 0.11.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2026
* @license MIT
@@ -52,7 +52,7 @@ var md5$1 = {exports: {}};
var isArray = Array.isArray;
var isView = ArrayBuffer.isView;
var isView = ArrayBuffer.isView ;
// [message: string, isString: bool]
var formatMessage = function (message) {
@@ -66,10 +66,14 @@ var md5$1 = {exports: {}};
if (message.constructor === ArrayBuffer) {
return [new Uint8Array(message), false];
}
if (!isArray(message) && !isView(message)) {
if (isArray(message)) {
return [message, false];
}
if (!isView(message)) {
throw new Error(INPUT_ERROR);
}
return [message, false];
// read the underlying bytes of any view (DataView, Uint16Array, ...)
return [new Uint8Array(message.buffer, message.byteOffset, message.byteLength), false];
};
/**
@@ -323,7 +327,7 @@ var md5$1 = {exports: {}};
var result = formatMessage(message);
message = result[0];
var isString = result[1];
var code, index = 0, i, length = message.length, blocks = this.blocks;
var code, code2, index = 0, i, length = message.length, blocks = this.blocks;
var buffer8 = this.buffer8;
while (index < length) {
@@ -349,12 +353,18 @@ var md5$1 = {exports: {}};
buffer8[i++] = 0xe0 | (code >>> 12);
buffer8[i++] = 0x80 | ((code >>> 6) & 0x3f);
buffer8[i++] = 0x80 | (code & 0x3f);
} else {
code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
} else if (code < 0xdc00 && (code2 = message.charCodeAt(index + 1)) >= 0xdc00 && code2 < 0xe000) {
++index;
code = 0x10000 + (((code & 0x3ff) << 10) | (code2 & 0x3ff));
buffer8[i++] = 0xf0 | (code >>> 18);
buffer8[i++] = 0x80 | ((code >>> 12) & 0x3f);
buffer8[i++] = 0x80 | ((code >>> 6) & 0x3f);
buffer8[i++] = 0x80 | (code & 0x3f);
} else {
// unpaired surrogate: U+FFFD
buffer8[i++] = 0xef;
buffer8[i++] = 0xbf;
buffer8[i++] = 0xbd;
}
}
}
@@ -733,7 +743,7 @@ var md5$1 = {exports: {}};
var i, result = formatMessage(key);
key = result[0];
if (result[1]) {
var bytes = [], length = key.length, index = 0, code;
var bytes = [], length = key.length, index = 0, code, code2;
for (i = 0; i < length; ++i) {
code = key.charCodeAt(i);
if (code < 0x80) {
@@ -745,12 +755,18 @@ var md5$1 = {exports: {}};
bytes[index++] = (0xe0 | (code >>> 12));
bytes[index++] = (0x80 | ((code >>> 6) & 0x3f));
bytes[index++] = (0x80 | (code & 0x3f));
} else {
code = 0x10000 + (((code & 0x3ff) << 10) | (key.charCodeAt(++i) & 0x3ff));
} else if (code < 0xdc00 && (code2 = key.charCodeAt(i + 1)) >= 0xdc00 && code2 < 0xe000) {
++i;
code = 0x10000 + (((code & 0x3ff) << 10) | (code2 & 0x3ff));
bytes[index++] = (0xf0 | (code >>> 18));
bytes[index++] = (0x80 | ((code >>> 12) & 0x3f));
bytes[index++] = (0x80 | ((code >>> 6) & 0x3f));
bytes[index++] = (0x80 | (code & 0x3f));
} else {
// unpaired surrogate: U+FFFD
bytes[index++] = 0xef;
bytes[index++] = 0xbf;
bytes[index++] = 0xbd;
}
}
key = bytes;
+28 -10
View File
@@ -13,7 +13,7 @@ var md5$1 = {exports: {}};
* [js-md5]{@link https://github.com/emn178/js-md5}
*
* @namespace md5
* @version 0.9.2
* @version 0.11.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2026
* @license MIT
@@ -61,7 +61,7 @@ var md5$1 = {exports: {}};
var isArray = Array.isArray;
var isView = ArrayBuffer.isView;
var isView = ArrayBuffer.isView ;
// [message: string, isString: bool]
var formatMessage = function (message) {
@@ -75,10 +75,14 @@ var md5$1 = {exports: {}};
if (message.constructor === ArrayBuffer) {
return [new Uint8Array(message), false];
}
if (!isArray(message) && !isView(message)) {
if (isArray(message)) {
return [message, false];
}
if (!isView(message)) {
throw new Error(INPUT_ERROR);
}
return [message, false];
// read the underlying bytes of any view (DataView, Uint16Array, ...)
return [new Uint8Array(message.buffer, message.byteOffset, message.byteLength), false];
};
/**
@@ -194,6 +198,8 @@ var md5$1 = {exports: {}};
throw new Error(INPUT_ERROR);
} else if (message.constructor === ArrayBuffer) {
message = new Uint8Array(message);
} else if (isView(message) && message.constructor !== Buffer) {
message = new Uint8Array(message.buffer, message.byteOffset, message.byteLength);
}
}
if (isArray(message) || isView(message) ||
@@ -359,7 +365,7 @@ var md5$1 = {exports: {}};
var result = formatMessage(message);
message = result[0];
var isString = result[1];
var code, index = 0, i, length = message.length, blocks = this.blocks;
var code, code2, index = 0, i, length = message.length, blocks = this.blocks;
var buffer8 = this.buffer8;
while (index < length) {
@@ -385,12 +391,18 @@ var md5$1 = {exports: {}};
buffer8[i++] = 0xe0 | (code >>> 12);
buffer8[i++] = 0x80 | ((code >>> 6) & 0x3f);
buffer8[i++] = 0x80 | (code & 0x3f);
} else {
code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
} else if (code < 0xdc00 && (code2 = message.charCodeAt(index + 1)) >= 0xdc00 && code2 < 0xe000) {
++index;
code = 0x10000 + (((code & 0x3ff) << 10) | (code2 & 0x3ff));
buffer8[i++] = 0xf0 | (code >>> 18);
buffer8[i++] = 0x80 | ((code >>> 12) & 0x3f);
buffer8[i++] = 0x80 | ((code >>> 6) & 0x3f);
buffer8[i++] = 0x80 | (code & 0x3f);
} else {
// unpaired surrogate: U+FFFD
buffer8[i++] = 0xef;
buffer8[i++] = 0xbf;
buffer8[i++] = 0xbd;
}
}
}
@@ -769,7 +781,7 @@ var md5$1 = {exports: {}};
var i, result = formatMessage(key);
key = result[0];
if (result[1]) {
var bytes = [], length = key.length, index = 0, code;
var bytes = [], length = key.length, index = 0, code, code2;
for (i = 0; i < length; ++i) {
code = key.charCodeAt(i);
if (code < 0x80) {
@@ -781,12 +793,18 @@ var md5$1 = {exports: {}};
bytes[index++] = (0xe0 | (code >>> 12));
bytes[index++] = (0x80 | ((code >>> 6) & 0x3f));
bytes[index++] = (0x80 | (code & 0x3f));
} else {
code = 0x10000 + (((code & 0x3ff) << 10) | (key.charCodeAt(++i) & 0x3ff));
} else if (code < 0xdc00 && (code2 = key.charCodeAt(i + 1)) >= 0xdc00 && code2 < 0xe000) {
++i;
code = 0x10000 + (((code & 0x3ff) << 10) | (code2 & 0x3ff));
bytes[index++] = (0xf0 | (code >>> 18));
bytes[index++] = (0x80 | ((code >>> 12) & 0x3f));
bytes[index++] = (0x80 | ((code >>> 6) & 0x3f));
bytes[index++] = (0x80 | (code & 0x3f));
} else {
// unpaired surrogate: U+FFFD
bytes[index++] = 0xef;
bytes[index++] = 0xbf;
bytes[index++] = 0xbd;
}
}
key = bytes;
+36 -12
View File
@@ -13,7 +13,7 @@ var md5$1 = {exports: {}};
* [js-md5]{@link https://github.com/emn178/js-md5}
*
* @namespace md5
* @version 0.9.2
* @version 0.11.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2026
* @license MIT
@@ -70,7 +70,7 @@ var md5$1 = {exports: {}};
};
}
var isView = ArrayBuffer.isView;
var isView = ARRAY_BUFFER ? ArrayBuffer.isView : null;
/* istanbul ignore else */
if (ARRAY_BUFFER && (root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW || !isView)) {
isView = function (obj) {
@@ -90,10 +90,14 @@ var md5$1 = {exports: {}};
if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {
return [new Uint8Array(message), false];
}
if (!isArray(message) && !isView(message)) {
if (isArray(message)) {
return [message, false];
}
if (!ARRAY_BUFFER || !isView(message)) {
throw new Error(INPUT_ERROR);
}
return [message, false];
// read the underlying bytes of any view (DataView, Uint16Array, ...)
return [new Uint8Array(message.buffer, message.byteOffset, message.byteLength), false];
};
/**
@@ -214,6 +218,8 @@ var md5$1 = {exports: {}};
throw new Error(INPUT_ERROR);
} else if (message.constructor === ArrayBuffer) {
message = new Uint8Array(message);
} else if (ARRAY_BUFFER && isView(message) && message.constructor !== Buffer) {
message = new Uint8Array(message.buffer, message.byteOffset, message.byteLength);
}
}
if (isArray(message) || isView(message) ||
@@ -381,7 +387,7 @@ var md5$1 = {exports: {}};
var result = formatMessage(message);
message = result[0];
var isString = result[1];
var code, index = 0, i, length = message.length, blocks = this.blocks;
var code, code2, index = 0, i, length = message.length, blocks = this.blocks;
var buffer8 = this.buffer8;
while (index < length) {
@@ -407,12 +413,18 @@ var md5$1 = {exports: {}};
buffer8[i++] = 0xe0 | (code >>> 12);
buffer8[i++] = 0x80 | ((code >>> 6) & 0x3f);
buffer8[i++] = 0x80 | (code & 0x3f);
} else {
code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
} else if (code < 0xdc00 && (code2 = message.charCodeAt(index + 1)) >= 0xdc00 && code2 < 0xe000) {
++index;
code = 0x10000 + (((code & 0x3ff) << 10) | (code2 & 0x3ff));
buffer8[i++] = 0xf0 | (code >>> 18);
buffer8[i++] = 0x80 | ((code >>> 12) & 0x3f);
buffer8[i++] = 0x80 | ((code >>> 6) & 0x3f);
buffer8[i++] = 0x80 | (code & 0x3f);
} else {
// unpaired surrogate: U+FFFD
buffer8[i++] = 0xef;
buffer8[i++] = 0xbf;
buffer8[i++] = 0xbd;
}
}
} else {
@@ -427,12 +439,18 @@ var md5$1 = {exports: {}};
blocks[i >>> 2] |= (0xe0 | (code >>> 12)) << SHIFT[i++ & 3];
blocks[i >>> 2] |= (0x80 | ((code >>> 6) & 0x3f)) << SHIFT[i++ & 3];
blocks[i >>> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
} else {
code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
} else if (code < 0xdc00 && (code2 = message.charCodeAt(index + 1)) >= 0xdc00 && code2 < 0xe000) {
++index;
code = 0x10000 + (((code & 0x3ff) << 10) | (code2 & 0x3ff));
blocks[i >>> 2] |= (0xf0 | (code >>> 18)) << SHIFT[i++ & 3];
blocks[i >>> 2] |= (0x80 | ((code >>> 12) & 0x3f)) << SHIFT[i++ & 3];
blocks[i >>> 2] |= (0x80 | ((code >>> 6) & 0x3f)) << SHIFT[i++ & 3];
blocks[i >>> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
} else {
// unpaired surrogate: U+FFFD
blocks[i >>> 2] |= 0xef << SHIFT[i++ & 3];
blocks[i >>> 2] |= 0xbf << SHIFT[i++ & 3];
blocks[i >>> 2] |= 0xbd << SHIFT[i++ & 3];
}
}
}
@@ -815,7 +833,7 @@ var md5$1 = {exports: {}};
var i, result = formatMessage(key);
key = result[0];
if (result[1]) {
var bytes = [], length = key.length, index = 0, code;
var bytes = [], length = key.length, index = 0, code, code2;
for (i = 0; i < length; ++i) {
code = key.charCodeAt(i);
if (code < 0x80) {
@@ -827,12 +845,18 @@ var md5$1 = {exports: {}};
bytes[index++] = (0xe0 | (code >>> 12));
bytes[index++] = (0x80 | ((code >>> 6) & 0x3f));
bytes[index++] = (0x80 | (code & 0x3f));
} else {
code = 0x10000 + (((code & 0x3ff) << 10) | (key.charCodeAt(++i) & 0x3ff));
} else if (code < 0xdc00 && (code2 = key.charCodeAt(i + 1)) >= 0xdc00 && code2 < 0xe000) {
++i;
code = 0x10000 + (((code & 0x3ff) << 10) | (code2 & 0x3ff));
bytes[index++] = (0xf0 | (code >>> 18));
bytes[index++] = (0x80 | ((code >>> 12) & 0x3f));
bytes[index++] = (0x80 | ((code >>> 6) & 0x3f));
bytes[index++] = (0x80 | (code & 0x3f));
} else {
// unpaired surrogate: U+FFFD
bytes[index++] = 0xef;
bytes[index++] = 0xbf;
bytes[index++] = 0xbd;
}
}
key = bytes;
+9 -9
View File
@@ -93,7 +93,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line803">line 803</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line821">line 821</a>
</li></ul></dd>
@@ -224,7 +224,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line722">line 722</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line740">line 740</a>
</li></ul></dd>
@@ -351,7 +351,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line734">line 734</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line752">line 752</a>
</li></ul></dd>
@@ -478,7 +478,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line772">line 772</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line790">line 790</a>
</li></ul></dd>
@@ -607,7 +607,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line756">line 756</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line774">line 774</a>
</li></ul></dd>
@@ -734,7 +734,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line700">line 700</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line718">line 718</a>
</li></ul></dd>
@@ -861,7 +861,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line655">line 655</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line673">line 673</a>
</li></ul></dd>
@@ -988,7 +988,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line688">line 688</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line706">line 706</a>
</li></ul></dd>
@@ -1173,7 +1173,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line363">line 363</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line369">line 369</a>
</li></ul></dd>
+9 -9
View File
@@ -47,7 +47,7 @@
<dt class="tag-version">Version:</dt>
<dd class="tag-version"><ul class="dummy"><li>0.9.2</li></ul></dd>
<dd class="tag-version"><ul class="dummy"><li>0.11.0</li></ul></dd>
@@ -244,7 +244,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line115">line 115</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line119">line 119</a>
</li></ul></dd>
@@ -417,7 +417,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line124">line 124</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line128">line 128</a>
</li></ul></dd>
@@ -590,7 +590,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line143">line 143</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line147">line 147</a>
</li></ul></dd>
@@ -765,7 +765,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line133">line 133</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line137">line 137</a>
</li></ul></dd>
@@ -880,7 +880,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line158">line 158</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line162">line 162</a>
</li></ul></dd>
@@ -1053,7 +1053,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line106">line 106</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line110">line 110</a>
</li></ul></dd>
@@ -1226,7 +1226,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line95">line 95</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line99">line 99</a>
</li></ul></dd>
@@ -1401,7 +1401,7 @@ md5('The quick brown fox jumps over the lazy dog');</code></pre>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line166">line 166</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line170">line 170</a>
</li></ul></dd>
+1 -1
View File
@@ -214,7 +214,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line882">line 882</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line906">line 906</a>
</li></ul></dd>
+5 -4
View File
@@ -45,8 +45,9 @@
<section>
<article><h1>js-md5</h1>
<p><a href="https://github.com/emn178/js-md5/actions/workflows/ci.yml"><img src="https://github.com/emn178/js-md5/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
<a href="https://coveralls.io/r/emn178/js-md5?branch=master"><img src="https://coveralls.io/repos/emn178/js-md5/badge.svg?branch=master" alt="Coverage Status"></a><br>
<a href="https://nodei.co/npm/js-md5/"><img src="https://nodei.co/npm/js-md5.png?stars&amp;downloads" alt="NPM"></a></p>
<a href="https://coveralls.io/r/emn178/js-md5?branch=master"><img src="https://coveralls.io/repos/emn178/js-md5/badge.svg?branch=master" alt="Coverage Status"></a>
<a href="https://www.npmjs.com/package/js-md5"><img src="https://img.shields.io/npm/v/js-md5" alt="NPM"></a>
<a href="https://www.jsdelivr.com/package/npm/js-md5"><img src="https://img.shields.io/jsdelivr/npm/hm/js-md5" alt="CDNJS"></a></p>
<p>A simple and fast MD5 hash function for JavaScript supports UTF-8 encoding.</p>
<h2>Demo</h2>
<p><a href="http://emn178.github.io/online-tools/md5.html">MD5 Online</a><br>
@@ -114,7 +115,7 @@ APIs, including <code>hex</code>, <code>array</code>, <code>digest</code>, and <
<li><a href="https://jsperf.app/jonuhi/9">Async Benchmark (jsperf.app)</a></li>
</ul>
<ul>
<li>js-md5 is the fastest synchronous MD5 library, but slower than Hash-WASM</li>
<li>js-md5 is the fastest for short strings in these benchmarks. For large data, WebAssembly-based libraries (e.g. Hash-WASM) are faster.</li>
</ul>
<ul>
<li><a href="https://github.com/emn178/js-md5/issues/19">File Benchmark - Issue #19</a></li>
@@ -166,7 +167,7 @@ md5('The quick brown fox jumps over the lazy dog.'); // e4d909c290d0fb1ca068ffad
// It also supports UTF-8 encoding
md5('中文'); // a7bac2239fcdcb3a067903d8077c4a07
// It also supports byte `Array`, `Uint8Array`, `ArrayBuffer`
// It also supports byte `Array`, `Uint8Array`, `ArrayBuffer` and other `ArrayBuffer` views (their underlying bytes are hashed)
md5([]); // d41d8cd98f00b204e9800998ecf8427e
md5(new Uint8Array([])); // d41d8cd98f00b204e9800998ecf8427e
+9 -9
View File
@@ -71,7 +71,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line225">line 225</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line231">line 231</a>
</li></ul></dd>
@@ -252,7 +252,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line251">line 251</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line257">line 257</a>
</li></ul></dd>
@@ -457,7 +457,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line261">line 261</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line267">line 267</a>
</li></ul></dd>
@@ -662,7 +662,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line282">line 282</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line288">line 288</a>
</li></ul></dd>
@@ -869,7 +869,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line271">line 271</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line277">line 277</a>
</li></ul></dd>
@@ -1042,7 +1042,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line298">line 298</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line304">line 304</a>
</li></ul></dd>
@@ -1247,7 +1247,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line241">line 241</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line247">line 247</a>
</li></ul></dd>
@@ -1452,7 +1452,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line228">line 228</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line234">line 234</a>
</li></ul></dd>
@@ -1659,7 +1659,7 @@ md5.hmac('key', 'The quick brown fox jumps over the lazy dog');</code></pre>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line307">line 307</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line313">line 313</a>
</li></ul></dd>
+9 -9
View File
@@ -93,7 +93,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line335">line 335</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line341">line 341</a>
</li></ul></dd>
@@ -208,7 +208,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line722">line 722</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line740">line 740</a>
</li></ul></dd>
@@ -330,7 +330,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line734">line 734</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line752">line 752</a>
</li></ul></dd>
@@ -452,7 +452,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line772">line 772</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line790">line 790</a>
</li></ul></dd>
@@ -576,7 +576,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line756">line 756</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line774">line 774</a>
</li></ul></dd>
@@ -698,7 +698,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line700">line 700</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line718">line 718</a>
</li></ul></dd>
@@ -820,7 +820,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line655">line 655</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line673">line 673</a>
</li></ul></dd>
@@ -942,7 +942,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line688">line 688</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line706">line 706</a>
</li></ul></dd>
@@ -1122,7 +1122,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line363">line 363</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line369">line 369</a>
</li></ul></dd>
+37 -13
View File
@@ -30,7 +30,7 @@
* [js-md5]{@link https://github.com/emn178/js-md5}
*
* @namespace md5
* @version 0.9.2
* @version 0.11.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2026
* @license MIT
@@ -94,7 +94,7 @@
};
}
var isView = ArrayBuffer.isView;
var isView = ARRAY_BUFFER ? ArrayBuffer.isView : null;
/* istanbul ignore else */
if (FEATURE_LEGACY &amp;&amp; ARRAY_BUFFER &amp;&amp; (root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW || !isView)) {
isView = function (obj) {
@@ -114,11 +114,15 @@
if (ARRAY_BUFFER &amp;&amp; message.constructor === ArrayBuffer) {
return [new Uint8Array(message), false];
}
if (!isArray(message) &amp;&amp; !isView(message)) {
if (isArray(message)) {
return [message, false];
}
if (!ARRAY_BUFFER || !isView(message)) {
throw new Error(INPUT_ERROR);
}
return [message, false];
}
// read the underlying bytes of any view (DataView, Uint16Array, ...)
return [new Uint8Array(message.buffer, message.byteOffset, message.byteLength), false];
};
/**
* @method hex
@@ -238,6 +242,8 @@
throw new Error(INPUT_ERROR);
} else if (message.constructor === ArrayBuffer) {
message = new Uint8Array(message);
} else if (ARRAY_BUFFER &amp;&amp; isView(message) &amp;&amp; message.constructor !== Buffer) {
message = new Uint8Array(message.buffer, message.byteOffset, message.byteLength);
}
}
if (isArray(message) || isView(message) ||
@@ -405,7 +411,7 @@
var result = formatMessage(message);
message = result[0];
var isString = result[1];
var code, index = 0, i, length = message.length, blocks = this.blocks;
var code, code2, index = 0, i, length = message.length, blocks = this.blocks;
var buffer8 = this.buffer8;
while (index &lt; length) {
@@ -431,12 +437,18 @@
buffer8[i++] = 0xe0 | (code >>> 12);
buffer8[i++] = 0x80 | ((code >>> 6) &amp; 0x3f);
buffer8[i++] = 0x80 | (code &amp; 0x3f);
} else {
code = 0x10000 + (((code &amp; 0x3ff) &lt;&lt; 10) | (message.charCodeAt(++index) &amp; 0x3ff));
} else if (code &lt; 0xdc00 &amp;&amp; (code2 = message.charCodeAt(index + 1)) >= 0xdc00 &amp;&amp; code2 &lt; 0xe000) {
++index;
code = 0x10000 + (((code &amp; 0x3ff) &lt;&lt; 10) | (code2 &amp; 0x3ff));
buffer8[i++] = 0xf0 | (code >>> 18);
buffer8[i++] = 0x80 | ((code >>> 12) &amp; 0x3f);
buffer8[i++] = 0x80 | ((code >>> 6) &amp; 0x3f);
buffer8[i++] = 0x80 | (code &amp; 0x3f);
} else {
// unpaired surrogate: U+FFFD
buffer8[i++] = 0xef;
buffer8[i++] = 0xbf;
buffer8[i++] = 0xbd;
}
}
} else {
@@ -451,12 +463,18 @@
blocks[i >>> 2] |= (0xe0 | (code >>> 12)) &lt;&lt; SHIFT[i++ &amp; 3];
blocks[i >>> 2] |= (0x80 | ((code >>> 6) &amp; 0x3f)) &lt;&lt; SHIFT[i++ &amp; 3];
blocks[i >>> 2] |= (0x80 | (code &amp; 0x3f)) &lt;&lt; SHIFT[i++ &amp; 3];
} else {
code = 0x10000 + (((code &amp; 0x3ff) &lt;&lt; 10) | (message.charCodeAt(++index) &amp; 0x3ff));
} else if (code &lt; 0xdc00 &amp;&amp; (code2 = message.charCodeAt(index + 1)) >= 0xdc00 &amp;&amp; code2 &lt; 0xe000) {
++index;
code = 0x10000 + (((code &amp; 0x3ff) &lt;&lt; 10) | (code2 &amp; 0x3ff));
blocks[i >>> 2] |= (0xf0 | (code >>> 18)) &lt;&lt; SHIFT[i++ &amp; 3];
blocks[i >>> 2] |= (0x80 | ((code >>> 12) &amp; 0x3f)) &lt;&lt; SHIFT[i++ &amp; 3];
blocks[i >>> 2] |= (0x80 | ((code >>> 6) &amp; 0x3f)) &lt;&lt; SHIFT[i++ &amp; 3];
blocks[i >>> 2] |= (0x80 | (code &amp; 0x3f)) &lt;&lt; SHIFT[i++ &amp; 3];
} else {
// unpaired surrogate: U+FFFD
blocks[i >>> 2] |= 0xef &lt;&lt; SHIFT[i++ &amp; 3];
blocks[i >>> 2] |= 0xbf &lt;&lt; SHIFT[i++ &amp; 3];
blocks[i >>> 2] |= 0xbd &lt;&lt; SHIFT[i++ &amp; 3];
}
}
}
@@ -839,7 +857,7 @@
var i, result = formatMessage(key);
key = result[0];
if (result[1]) {
var bytes = [], length = key.length, index = 0, code;
var bytes = [], length = key.length, index = 0, code, code2;
for (i = 0; i &lt; length; ++i) {
code = key.charCodeAt(i);
if (code &lt; 0x80) {
@@ -851,12 +869,18 @@
bytes[index++] = (0xe0 | (code >>> 12));
bytes[index++] = (0x80 | ((code >>> 6) &amp; 0x3f));
bytes[index++] = (0x80 | (code &amp; 0x3f));
} else {
code = 0x10000 + (((code &amp; 0x3ff) &lt;&lt; 10) | (key.charCodeAt(++i) &amp; 0x3ff));
} else if (code &lt; 0xdc00 &amp;&amp; (code2 = key.charCodeAt(i + 1)) >= 0xdc00 &amp;&amp; code2 &lt; 0xe000) {
++i;
code = 0x10000 + (((code &amp; 0x3ff) &lt;&lt; 10) | (code2 &amp; 0x3ff));
bytes[index++] = (0xf0 | (code >>> 18));
bytes[index++] = (0x80 | ((code >>> 12) &amp; 0x3f));
bytes[index++] = (0x80 | ((code >>> 6) &amp; 0x3f));
bytes[index++] = (0x80 | (code &amp; 0x3f));
} else {
// unpaired surrogate: U+FFFD
bytes[index++] = 0xef;
bytes[index++] = 0xbf;
bytes[index++] = 0xbd;
}
}
key = bytes;
Vendored
+1 -1
View File
@@ -1,4 +1,4 @@
type Message = string | number[] | ArrayBuffer | Uint8Array;
type Message = string | number[] | ArrayBuffer | ArrayBufferView;
interface Hasher {
/**
+87 -638
View File
@@ -1,12 +1,12 @@
{
"name": "js-md5",
"version": "0.9.2",
"version": "0.11.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "js-md5",
"version": "0.9.2",
"version": "0.11.0",
"license": "MIT",
"devDependencies": {
"@rollup/plugin-commonjs": "^29.0.3",
@@ -287,23 +287,12 @@
"node": ">=6.9.0"
}
},
"node_modules/@isaacs/cliui": {
"version": "8.0.2",
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
"integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==",
"node_modules/@isaacs/nonrecursive-glob-match": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@isaacs/nonrecursive-glob-match/-/nonrecursive-glob-match-1.1.0.tgz",
"integrity": "sha512-GPm/Dbvk5RLmhRnxXIa7nTpK0xtl4E0wj0MslsuNiJ1FIROU+2+9lgUC/dgF7Ey4QCWhfEsgxilMRMCdHPfDfw==",
"dev": true,
"license": "ISC",
"dependencies": {
"string-width": "^5.1.2",
"string-width-cjs": "npm:string-width@^4.2.0",
"strip-ansi": "^7.0.1",
"strip-ansi-cjs": "npm:strip-ansi@^6.0.1",
"wrap-ansi": "^8.1.0",
"wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0"
},
"engines": {
"node": ">=12"
}
"license": "BlueOak-1.0.0"
},
"node_modules/@istanbuljs/load-nyc-config": {
"version": "1.1.0",
@@ -347,9 +336,9 @@
}
},
"node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": {
"version": "3.15.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.15.0.tgz",
"integrity": "sha512-ttBQIIQPDeLjpPOohtUdXuXUVoA2uIB6fEH9HyJ7234s5mBJ5wTx20njxplLZQgLaOfpmPQA7X2t5AX6tIPbog==",
"version": "3.15.2",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.15.2.tgz",
"integrity": "sha512-6EuL879VkRA+1Cz578mKMiKvjPNEuk6+r1JaFzoSWejZmtf7xWbIyw1e3KkxlkzTIt9Taw6JBhEppG7utc1P+w==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -486,17 +475,6 @@
"node": ">=v12.0.0"
}
},
"node_modules/@pkgjs/parseargs": {
"version": "0.11.0",
"resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
"integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==",
"dev": true,
"license": "MIT",
"optional": true,
"engines": {
"node": ">=14"
}
},
"node_modules/@rollup/plugin-commonjs": {
"version": "29.0.3",
"resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-29.0.3.tgz",
@@ -547,16 +525,6 @@
}
}
},
"node_modules/@rollup/plugin-terser/node_modules/serialize-javascript": {
"version": "7.0.7",
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-7.0.7.tgz",
"integrity": "sha512-YAy8Od6KV+uuwUuU50np8fGB/Aues6Y0nAhA9y/hId74PlKUcme4pXcBD46NWKr1Q4osN/iseZ17YqO1XfmI8g==",
"dev": true,
"license": "BSD-3-Clause",
"engines": {
"node": ">=20.0.0"
}
},
"node_modules/@rollup/pluginutils": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.4.0.tgz",
@@ -989,19 +957,6 @@
"node": ">=8"
}
},
"node_modules/ansi-regex": {
"version": "6.2.2",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",
"integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/ansi-regex?sponsor=1"
}
},
"node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
@@ -1046,16 +1001,19 @@
"license": "Python-2.0"
},
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
"integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",
"dev": true,
"license": "MIT"
"license": "MIT",
"engines": {
"node": "18 || 20 || >=22"
}
},
"node_modules/baseline-browser-mapping": {
"version": "2.10.43",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.43.tgz",
"integrity": "sha512-AjYpR78kDWAY3Efj+cDTFH9t9SCoL7OoTp1BOb0mQV7S+6CiLwnWM3FyxhJtdPufDFKzmCSFoUncKjWgJEZTCQ==",
"version": "2.11.21",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.21.tgz",
"integrity": "sha512-uh8vpY/1/YyFkunIDFH/12p7/7VdPKA1hejMVEbdkEaWnUz0Hesvx5EbiU6XxjyHZIOju+ZMbQJkRh+es3/spQ==",
"dev": true,
"license": "Apache-2.0",
"bin": {
@@ -1073,13 +1031,16 @@
"license": "MIT"
},
"node_modules/brace-expansion": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.2.tgz",
"integrity": "sha512-w5JZcKgdhDOgOwm8H+KgbosopHMuGcl6qbulwjtz3SM7I7P3yW1eAjzMPLrIE+NQ9vjgANKHWeMHnrT0OXW1oA==",
"version": "5.0.13",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.13.tgz",
"integrity": "sha512-Vh3dmFbc4wZeox7M9I/0L9GfFd83Su4+yCck/OF9Gi/P/dAHn0RT7X4K9R7gMNMhDck3DvhR6QXsnQdjjgwNvQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"balanced-match": "^1.0.0"
"balanced-match": "^4.0.2"
},
"engines": {
"node": "20 || >=22"
}
},
"node_modules/browser-stdout": {
@@ -1090,9 +1051,9 @@
"license": "ISC"
},
"node_modules/browserslist": {
"version": "4.28.6",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.6.tgz",
"integrity": "sha512-FQBYNK15VMslhLHpA7+n+n1GOlF1kId2xcCg7/j95f24AOF6VDYMNH4mFxF7KuaTdv627faazpOAjFzMrfJOUw==",
"version": "4.28.9",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.9.tgz",
"integrity": "sha512-EWazOblFYUvlGZcfGhPUPmYh3nikUxBVb+y9MJun5f3hBi812X+8MSQTujLBtgK3cf51fJWbWfOjyeO954d+Eg==",
"dev": true,
"funding": [
{
@@ -1110,11 +1071,11 @@
],
"license": "MIT",
"dependencies": {
"baseline-browser-mapping": "^2.10.42",
"caniuse-lite": "^1.0.30001803",
"electron-to-chromium": "^1.5.389",
"node-releases": "^2.0.51",
"update-browserslist-db": "^1.2.3"
"baseline-browser-mapping": "^2.11.20",
"caniuse-lite": "^1.0.30001810",
"electron-to-chromium": "^1.5.420",
"node-releases": "^2.0.54",
"update-browserslist-db": "^1.3.2"
},
"bin": {
"browserslist": "cli.js"
@@ -1157,9 +1118,9 @@
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001806",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001806.tgz",
"integrity": "sha512-72Cuvd95zbSYPKq6Fhg8eDJRlzgWDf7/mtoZv6Qe/DYNCEBdNxoA3+rZAU2ZhGCpZlns3EssFavaZomckT5Uuw==",
"version": "1.0.30001810",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001810.tgz",
"integrity": "sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg==",
"dev": true,
"funding": [
{
@@ -1425,36 +1386,22 @@
}
},
"node_modules/diff": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz",
"integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==",
"version": "8.0.4",
"resolved": "https://registry.npmjs.org/diff/-/diff-8.0.4.tgz",
"integrity": "sha512-DPi0FmjiSU5EvQV0++GFDOJ9ASQUVFh5kD+OzOnYdi7n3Wpm9hWWGfB/O2blfHcMVTL5WkQXSnRiK9makhrcnw==",
"dev": true,
"license": "BSD-3-Clause",
"engines": {
"node": ">=0.3.1"
}
},
"node_modules/eastasianwidth": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
"integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==",
"dev": true,
"license": "MIT"
},
"node_modules/electron-to-chromium": {
"version": "1.5.393",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.393.tgz",
"integrity": "sha512-kiDJdIUawuEIcp9XoICKp1iTYDEbgguIPq526N1Q7jIQDeQ3CqoMx71025PI/7E48Ddtw2HuWsVjY7afEgNxmg==",
"version": "1.5.422",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.422.tgz",
"integrity": "sha512-UvA/32XqrLDdZSn7Jllo1AYNcWji/G0d5M0GTViE7KoGBiMunw3a34Sb2KO4ZZyrSEhqsxFoVhWWJshdyfKqJA==",
"dev": true,
"license": "ISC"
},
"node_modules/emoji-regex": {
"version": "9.2.2",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",
"integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==",
"dev": true,
"license": "MIT"
},
"node_modules/entities": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
@@ -1679,22 +1626,18 @@
}
},
"node_modules/glob": {
"version": "10.5.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz",
"integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==",
"deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me",
"version": "14.0.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-14.0.6.tgz",
"integrity": "sha512-OwXjVP2svY5EyLY75Vek96C8qK43gqrt4xsZ+qSILdnaEiJPXkd62mcfUSNx/TQErQRdu5uM5kF67sfONragKw==",
"dev": true,
"license": "ISC",
"license": "BlueOak-1.0.0",
"dependencies": {
"foreground-child": "^3.1.0",
"jackspeak": "^3.1.2",
"minimatch": "^9.0.4",
"minipass": "^7.1.2",
"package-json-from-dist": "^1.0.0",
"path-scurry": "^1.11.1"
"minimatch": "^11.0.5",
"minipass": "^7.1.3",
"path-scurry": "^3.0.0"
},
"bin": {
"glob": "dist/esm/bin.mjs"
"engines": {
"node": "18 || 20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
@@ -1991,22 +1934,6 @@
"node": ">=8"
}
},
"node_modules/jackspeak": {
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz",
"integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==",
"dev": true,
"license": "BlueOak-1.0.0",
"dependencies": {
"@isaacs/cliui": "^8.0.2"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
},
"optionalDependencies": {
"@pkgjs/parseargs": "^0.11.0"
}
},
"node_modules/js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
@@ -2015,9 +1942,9 @@
"license": "MIT"
},
"node_modules/js-yaml": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz",
"integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==",
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz",
"integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==",
"dev": true,
"funding": [
{
@@ -2286,16 +2213,17 @@
"license": "MIT"
},
"node_modules/minimatch": {
"version": "9.0.9",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz",
"integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==",
"version": "11.0.8",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.8.tgz",
"integrity": "sha512-nFQuYSTVrGvysVBps5Ih+0BdnYFN/Cj3C816r6+p7yK+FHrVLGE4O4N9AFwykrlNlvM2HYt+Rad1Uiro6h88Ig==",
"dev": true,
"license": "ISC",
"license": "BlueOak-1.0.0",
"dependencies": {
"brace-expansion": "^2.0.2"
"@isaacs/nonrecursive-glob-match": "^1.1.0",
"brace-expansion": "^5.0.12"
},
"engines": {
"node": ">=16 || 14 >=14.17"
"node": "20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
@@ -2395,9 +2323,9 @@
}
},
"node_modules/node-releases": {
"version": "2.0.51",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.51.tgz",
"integrity": "sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ==",
"version": "2.0.54",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.54.tgz",
"integrity": "sha512-YHs7BmmcsdAI5Ozuf8JZo6PT0mv2GIWC9vMfvUC3dp65M8hn7Ux8CPL+2oBI7juNuj9d0ndhTcznq2ODBps9cQ==",
"dev": true,
"license": "MIT",
"engines": {
@@ -2456,29 +2384,6 @@
"node": ">=8"
}
},
"node_modules/nyc/node_modules/balanced-match": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
"integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",
"dev": true,
"license": "MIT",
"engines": {
"node": "18 || 20 || >=22"
}
},
"node_modules/nyc/node_modules/brace-expansion": {
"version": "5.0.7",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz",
"integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==",
"dev": true,
"license": "MIT",
"dependencies": {
"balanced-match": "^4.0.2"
},
"engines": {
"node": "18 || 20 || >=22"
}
},
"node_modules/nyc/node_modules/cliui": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
@@ -2512,24 +2417,6 @@
"node": ">=8"
}
},
"node_modules/nyc/node_modules/glob": {
"version": "13.0.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz",
"integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==",
"dev": true,
"license": "BlueOak-1.0.0",
"dependencies": {
"minimatch": "^10.2.2",
"minipass": "^7.1.3",
"path-scurry": "^2.0.2"
},
"engines": {
"node": "18 || 20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/nyc/node_modules/locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
@@ -2543,32 +2430,6 @@
"node": ">=8"
}
},
"node_modules/nyc/node_modules/lru-cache": {
"version": "11.5.2",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.2.tgz",
"integrity": "sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==",
"dev": true,
"license": "BlueOak-1.0.0",
"engines": {
"node": "20 || >=22"
}
},
"node_modules/nyc/node_modules/minimatch": {
"version": "10.2.5",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz",
"integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==",
"dev": true,
"license": "BlueOak-1.0.0",
"dependencies": {
"brace-expansion": "^5.0.5"
},
"engines": {
"node": "18 || 20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/nyc/node_modules/p-limit": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
@@ -2598,23 +2459,6 @@
"node": ">=8"
}
},
"node_modules/nyc/node_modules/path-scurry": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz",
"integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==",
"dev": true,
"license": "BlueOak-1.0.0",
"dependencies": {
"lru-cache": "^11.0.0",
"minipass": "^7.1.2"
},
"engines": {
"node": "18 || 20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/nyc/node_modules/signal-exit": {
"version": "3.0.7",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
@@ -2808,28 +2652,31 @@
}
},
"node_modules/path-scurry": {
"version": "1.11.1",
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz",
"integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==",
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-3.0.0.tgz",
"integrity": "sha512-1pTbQqH1wIwMi/eleQ5leFTTCkzFsPcgXNjwOA8YGGW/W4/kHT3dssE7Z6NH+zuqNLOzOB0uaD61yl7cAcVhgg==",
"dev": true,
"license": "BlueOak-1.0.0",
"dependencies": {
"lru-cache": "^10.2.0",
"minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
"lru-cache": "^11.0.0",
"minipass": "^7.1.2"
},
"engines": {
"node": ">=16 || 14 >=14.18"
"node": "18 || 20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/path-scurry/node_modules/lru-cache": {
"version": "10.4.3",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz",
"integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==",
"version": "11.5.3",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz",
"integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==",
"dev": true,
"license": "ISC"
"license": "BlueOak-1.0.0",
"engines": {
"node": "20 || >=22"
}
},
"node_modules/picocolors": {
"version": "1.1.1",
@@ -2943,16 +2790,6 @@
"node": ">=6"
}
},
"node_modules/randombytes": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
"integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"safe-buffer": "^5.1.0"
}
},
"node_modules/readdirp": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz",
@@ -3051,90 +2888,6 @@
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/rimraf/node_modules/balanced-match": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
"integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",
"dev": true,
"license": "MIT",
"engines": {
"node": "18 || 20 || >=22"
}
},
"node_modules/rimraf/node_modules/brace-expansion": {
"version": "5.0.7",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz",
"integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==",
"dev": true,
"license": "MIT",
"dependencies": {
"balanced-match": "^4.0.2"
},
"engines": {
"node": "18 || 20 || >=22"
}
},
"node_modules/rimraf/node_modules/glob": {
"version": "13.0.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz",
"integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==",
"dev": true,
"license": "BlueOak-1.0.0",
"dependencies": {
"minimatch": "^10.2.2",
"minipass": "^7.1.3",
"path-scurry": "^2.0.2"
},
"engines": {
"node": "18 || 20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/rimraf/node_modules/lru-cache": {
"version": "11.5.2",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.2.tgz",
"integrity": "sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==",
"dev": true,
"license": "BlueOak-1.0.0",
"engines": {
"node": "20 || >=22"
}
},
"node_modules/rimraf/node_modules/minimatch": {
"version": "10.2.5",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz",
"integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==",
"dev": true,
"license": "BlueOak-1.0.0",
"dependencies": {
"brace-expansion": "^5.0.5"
},
"engines": {
"node": "18 || 20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/rimraf/node_modules/path-scurry": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz",
"integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==",
"dev": true,
"license": "BlueOak-1.0.0",
"dependencies": {
"lru-cache": "^11.0.0",
"minipass": "^7.1.2"
},
"engines": {
"node": "18 || 20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/rollup": {
"version": "4.62.2",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.2.tgz",
@@ -3180,27 +2933,6 @@
"fsevents": "~2.3.2"
}
},
"node_modules/safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"license": "MIT"
},
"node_modules/semver": {
"version": "7.8.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz",
@@ -3215,13 +2947,13 @@
}
},
"node_modules/serialize-javascript": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz",
"integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==",
"version": "7.1.4",
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-7.1.4.tgz",
"integrity": "sha512-FqlEuoTq/zRmA4Lg6aOqyH3lCHbUtCB0bmHCeFniX2GBdDqMJM3FwdvEhlE5Pim1dlt2FfBdVPmUNNiGhhKqpw==",
"dev": true,
"license": "BSD-3-Clause",
"dependencies": {
"randombytes": "^2.1.0"
"engines": {
"node": ">=20.0.0"
}
},
"node_modules/set-blocking": {
@@ -3345,110 +3077,6 @@
"dev": true,
"license": "BSD-3-Clause"
},
"node_modules/string-width": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",
"integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==",
"dev": true,
"license": "MIT",
"dependencies": {
"eastasianwidth": "^0.2.0",
"emoji-regex": "^9.2.2",
"strip-ansi": "^7.0.1"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/string-width-cjs": {
"name": "string-width",
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dev": true,
"license": "MIT",
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/string-width-cjs/node_modules/ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/string-width-cjs/node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dev": true,
"license": "MIT"
},
"node_modules/string-width-cjs/node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/strip-ansi": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",
"integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-regex": "^6.2.2"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/strip-ansi?sponsor=1"
}
},
"node_modules/strip-ansi-cjs": {
"name": "strip-ansi",
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/strip-ansi-cjs/node_modules/ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/strip-bom": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz",
@@ -3522,90 +3150,6 @@
"node": "20 || >=22"
}
},
"node_modules/test-exclude/node_modules/balanced-match": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
"integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",
"dev": true,
"license": "MIT",
"engines": {
"node": "18 || 20 || >=22"
}
},
"node_modules/test-exclude/node_modules/brace-expansion": {
"version": "5.0.7",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz",
"integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==",
"dev": true,
"license": "MIT",
"dependencies": {
"balanced-match": "^4.0.2"
},
"engines": {
"node": "18 || 20 || >=22"
}
},
"node_modules/test-exclude/node_modules/glob": {
"version": "13.0.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz",
"integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==",
"dev": true,
"license": "BlueOak-1.0.0",
"dependencies": {
"minimatch": "^10.2.2",
"minipass": "^7.1.3",
"path-scurry": "^2.0.2"
},
"engines": {
"node": "18 || 20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/test-exclude/node_modules/lru-cache": {
"version": "11.5.2",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.2.tgz",
"integrity": "sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==",
"dev": true,
"license": "BlueOak-1.0.0",
"engines": {
"node": "20 || >=22"
}
},
"node_modules/test-exclude/node_modules/minimatch": {
"version": "10.2.5",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz",
"integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==",
"dev": true,
"license": "BlueOak-1.0.0",
"dependencies": {
"brace-expansion": "^5.0.5"
},
"engines": {
"node": "18 || 20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/test-exclude/node_modules/path-scurry": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz",
"integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==",
"dev": true,
"license": "BlueOak-1.0.0",
"dependencies": {
"lru-cache": "^11.0.0",
"minipass": "^7.1.2"
},
"engines": {
"node": "18 || 20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/tiny-worker": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/tiny-worker/-/tiny-worker-2.3.0.tgz",
@@ -3651,9 +3195,9 @@
"license": "MIT"
},
"node_modules/update-browserslist-db": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz",
"integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==",
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.2.tgz",
"integrity": "sha512-UQ+MSxlhRm1bzjhU+DcuXfjFO1FzNtqhK5+9Yvlp90ItDLk5vT932A0rFu619nf7RVS+Y/VeaUW1jaRDqZ8VJw==",
"dev": true,
"funding": [
{
@@ -3711,101 +3255,6 @@
"dev": true,
"license": "Apache-2.0"
},
"node_modules/wrap-ansi": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz",
"integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-styles": "^6.1.0",
"string-width": "^5.0.1",
"strip-ansi": "^7.0.1"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
"node_modules/wrap-ansi-cjs": {
"name": "wrap-ansi",
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
"node_modules/wrap-ansi-cjs/node_modules/ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/wrap-ansi-cjs/node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dev": true,
"license": "MIT"
},
"node_modules/wrap-ansi-cjs/node_modules/string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dev": true,
"license": "MIT",
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/wrap-ansi-cjs/node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/wrap-ansi/node_modules/ansi-styles": {
"version": "6.2.3",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz",
"integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/write-file-atomic": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz",
+7 -1
View File
@@ -1,6 +1,6 @@
{
"name": "js-md5",
"version": "0.9.2",
"version": "0.11.0",
"description": "A simple MD5 hash function for JavaScript supports UTF-8 encoding.",
"main": "src/md5.js",
"module": "build/md5.mjs",
@@ -77,5 +77,11 @@
"browser": {
"crypto": false,
"buffer": false
},
"overrides": {
"diff": "^8.0.3",
"glob": "^14.0.2",
"minimatch": "^11.0.1",
"serialize-javascript": "^7.1.3"
}
}
+37 -13
View File
@@ -2,7 +2,7 @@
* [js-md5]{@link https://github.com/emn178/js-md5}
*
* @namespace md5
* @version 0.9.2
* @version 0.11.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2026
* @license MIT
@@ -66,7 +66,7 @@
};
}
var isView = ArrayBuffer.isView;
var isView = ARRAY_BUFFER ? ArrayBuffer.isView : null;
/* istanbul ignore else */
if (FEATURE_LEGACY && ARRAY_BUFFER && (root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW || !isView)) {
isView = function (obj) {
@@ -86,11 +86,15 @@
if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {
return [new Uint8Array(message), false];
}
if (!isArray(message) && !isView(message)) {
if (isArray(message)) {
return [message, false];
}
if (!ARRAY_BUFFER || !isView(message)) {
throw new Error(INPUT_ERROR);
}
return [message, false];
}
// read the underlying bytes of any view (DataView, Uint16Array, ...)
return [new Uint8Array(message.buffer, message.byteOffset, message.byteLength), false];
};
/**
* @method hex
@@ -210,6 +214,8 @@
throw new Error(INPUT_ERROR);
} else if (message.constructor === ArrayBuffer) {
message = new Uint8Array(message);
} else if (ARRAY_BUFFER && isView(message) && message.constructor !== Buffer) {
message = new Uint8Array(message.buffer, message.byteOffset, message.byteLength);
}
}
if (isArray(message) || isView(message) ||
@@ -377,7 +383,7 @@
var result = formatMessage(message);
message = result[0];
var isString = result[1];
var code, index = 0, i, length = message.length, blocks = this.blocks;
var code, code2, index = 0, i, length = message.length, blocks = this.blocks;
var buffer8 = this.buffer8;
while (index < length) {
@@ -403,12 +409,18 @@
buffer8[i++] = 0xe0 | (code >>> 12);
buffer8[i++] = 0x80 | ((code >>> 6) & 0x3f);
buffer8[i++] = 0x80 | (code & 0x3f);
} else {
code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
} else if (code < 0xdc00 && (code2 = message.charCodeAt(index + 1)) >= 0xdc00 && code2 < 0xe000) {
++index;
code = 0x10000 + (((code & 0x3ff) << 10) | (code2 & 0x3ff));
buffer8[i++] = 0xf0 | (code >>> 18);
buffer8[i++] = 0x80 | ((code >>> 12) & 0x3f);
buffer8[i++] = 0x80 | ((code >>> 6) & 0x3f);
buffer8[i++] = 0x80 | (code & 0x3f);
} else {
// unpaired surrogate: U+FFFD
buffer8[i++] = 0xef;
buffer8[i++] = 0xbf;
buffer8[i++] = 0xbd;
}
}
} else {
@@ -423,12 +435,18 @@
blocks[i >>> 2] |= (0xe0 | (code >>> 12)) << SHIFT[i++ & 3];
blocks[i >>> 2] |= (0x80 | ((code >>> 6) & 0x3f)) << SHIFT[i++ & 3];
blocks[i >>> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
} else {
code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
} else if (code < 0xdc00 && (code2 = message.charCodeAt(index + 1)) >= 0xdc00 && code2 < 0xe000) {
++index;
code = 0x10000 + (((code & 0x3ff) << 10) | (code2 & 0x3ff));
blocks[i >>> 2] |= (0xf0 | (code >>> 18)) << SHIFT[i++ & 3];
blocks[i >>> 2] |= (0x80 | ((code >>> 12) & 0x3f)) << SHIFT[i++ & 3];
blocks[i >>> 2] |= (0x80 | ((code >>> 6) & 0x3f)) << SHIFT[i++ & 3];
blocks[i >>> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
} else {
// unpaired surrogate: U+FFFD
blocks[i >>> 2] |= 0xef << SHIFT[i++ & 3];
blocks[i >>> 2] |= 0xbf << SHIFT[i++ & 3];
blocks[i >>> 2] |= 0xbd << SHIFT[i++ & 3];
}
}
}
@@ -811,7 +829,7 @@
var i, result = formatMessage(key);
key = result[0];
if (result[1]) {
var bytes = [], length = key.length, index = 0, code;
var bytes = [], length = key.length, index = 0, code, code2;
for (i = 0; i < length; ++i) {
code = key.charCodeAt(i);
if (code < 0x80) {
@@ -823,12 +841,18 @@
bytes[index++] = (0xe0 | (code >>> 12));
bytes[index++] = (0x80 | ((code >>> 6) & 0x3f));
bytes[index++] = (0x80 | (code & 0x3f));
} else {
code = 0x10000 + (((code & 0x3ff) << 10) | (key.charCodeAt(++i) & 0x3ff));
} else if (code < 0xdc00 && (code2 = key.charCodeAt(i + 1)) >= 0xdc00 && code2 < 0xe000) {
++i;
code = 0x10000 + (((code & 0x3ff) << 10) | (code2 & 0x3ff));
bytes[index++] = (0xf0 | (code >>> 18));
bytes[index++] = (0x80 | ((code >>> 12) & 0x3f));
bytes[index++] = (0x80 | ((code >>> 6) & 0x3f));
bytes[index++] = (0x80 | (code & 0x3f));
} else {
// unpaired surrogate: U+FFFD
bytes[index++] = 0xef;
bytes[index++] = 0xbf;
bytes[index++] = 0xbd;
}
}
key = bytes;
+10
View File
@@ -57,4 +57,14 @@ expect(browserLite.base64).to.be(undefined);
expect(browserLite.buffer).to.be(undefined);
expect(browserLite.hmac).to.be(undefined);
// legacy builds load in browsers without ArrayBuffer
['build/md5.js', 'build/md5.min.js'].forEach(function (file) {
var context = vm.createContext({});
vm.runInContext('var window = this; delete ArrayBuffer; delete Uint8Array; delete Uint32Array; delete DataView;', context);
vm.runInContext(fs.readFileSync(file, 'utf8'), context);
expect(context.md5('abc')).to.be(EXPECTED_MD5);
expect(context.md5.create().update('a').update([98, 99]).hex()).to.be(EXPECTED_MD5);
expect(context.md5.hmac('key', 'abc')).to.be(EXPECTED_HMAC);
});
console.log('Build variants: PASS');
+4
View File
@@ -45,6 +45,10 @@
'05fe3b294344f4e93c811e10f9825a38': ['中文', '中文'],
'c1bc6df91f38e6332b8562324005103d': ['aécio', 'aécio'],
'14eef78533c35078177d11fb4593a19e': ['𠜎', '𠜎']
},
'UTF8 unpaired surrogates': {
'2ef4c67742d4f436cbdfdbad133659af': ['\ud800', 'a\ud83db'],
'f537b6e97a3e8b23a9e87a29fb5c4173': ['a\udc00b', '\ud83d\ude00\udfff']
}
}
};
+15
View File
@@ -27,6 +27,16 @@
'edce615b179e6e29be23145b77ebbd61': '訊息摘要演算法第五版(英語:Message-Digest Algorithm 5,縮寫為MD5),是當前電腦領域用於確保資訊傳輸完整一致而廣泛使用的雜湊演算法之一',
'ad36c9ab669a0ba9ce46d3ce9134de34': '訊息摘要演算法第五版(英語:Message-Digest Algorithm 5,縮寫為MD5),是當前電腦領域用於確保資訊傳輸完整一致而廣泛使用的雜湊演算法之一(又譯雜湊演算法、摘要演算法等),主流程式語言普遍已有MD5的實作。'
},
'UTF8 unpaired surrogates': {
'9b759040321a408a5c7768b4511287a6': '\ud800',
'e240e5e976deb550ea69ec12f01d19ea': '\udc00x',
'ff6405018d5ab2642e35fdba389b7c51': 'a\ud83db',
'ef175e9b596d296034dda690087252f8': 'a\udc00',
'2e906629739ba554e03c1201e05b94f2': '\ud83d\ud83d\ude00',
'468a7f02af0808ae39ef3e3629ae048c': '\ud83d\ude00\udfff',
'6785af8cb378bd9950085c5d6375f9ad': Array(57).join('0') + '\ud800',
'a20fb4cd303a71aa61dd524e8fc525ef': Array(64).join('0') + '\ud800b'
},
'special length': {
'a119de63e4b2398427da06dd780263b3': '0123456780123456780123456780123456780123456780123456780',
'ddafd84ebe63aebc4626b037a569d78b': '01234567801234567801234567801234567801234567801234567801',
@@ -89,6 +99,11 @@
testCases['Int8Array'] = {
'9e107d9d372bb6826bd81d3542a419d6': new Int8Array([84, 104, 101, 32, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 32, 102, 111, 120, 32, 106, 117, 109, 112, 115, 32, 111, 118, 101, 114, 32, 116, 104, 101, 32, 108, 97, 122, 121, 32, 100, 111, 103])
};
testCases['ArrayBuffer view'] = {
'71f3ccb98530e3072e2eaef01da20d8c': new Int8Array([-1, -128, 65, 0, -2]),
'050d144172d916d0846f839e0412e929': new Uint16Array(new Uint8Array([2, 1]).buffer),
'eb61eead90e3b899c6bcbe27ac581660': new DataView(new Uint8Array([9, 72, 69, 76, 76, 79, 9]).buffer, 1, 5)
};
testCases['ArrayBuffer'] = {
'93b885adfe0da089cdf634904fd59f71': new ArrayBuffer(1)
};