js-md5 0.8.2 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +44 -0
- package/.github/workflows/publish.yml +32 -0
- package/CHANGELOG.md +14 -0
- package/LICENSE.txt +1 -1
- package/README.md +32 -6
- package/build/md5-lite.js +612 -0
- package/build/md5-lite.min.js +10 -0
- package/build/md5-lite.min.mjs +10 -0
- package/build/md5-lite.mjs +589 -0
- package/build/md5-lite.node.mjs +625 -0
- package/build/md5.js +898 -0
- package/build/md5.min.js +3 -3
- package/build/md5.min.mjs +10 -0
- package/build/md5.mjs +870 -0
- package/build/md5.modern.js +852 -0
- package/build/md5.modern.min.js +10 -0
- package/build/md5.modern.min.mjs +10 -0
- package/build/md5.modern.mjs +829 -0
- package/build/md5.modern.node.mjs +865 -0
- package/build/md5.node.mjs +911 -0
- package/package.json +39 -6
- package/rollup.config.mjs +106 -0
- package/src/md5.js +72 -42
- package/src/md5.mjs +4 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
pull_request:
|
|
8
|
+
branches:
|
|
9
|
+
- master
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
ci:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
strategy:
|
|
15
|
+
matrix:
|
|
16
|
+
node-version: [16.x, 18.x, 20.x, 22.x]
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout code
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Set up Node ${{ matrix.node-version }}
|
|
22
|
+
uses: actions/setup-node@v4
|
|
23
|
+
with:
|
|
24
|
+
node-version: ${{ matrix.node-version }}
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: npm ci
|
|
28
|
+
|
|
29
|
+
- name: Build
|
|
30
|
+
if: matrix.node-version == '22.x'
|
|
31
|
+
run: npm run build
|
|
32
|
+
|
|
33
|
+
- name: Run tests
|
|
34
|
+
run: npm test
|
|
35
|
+
|
|
36
|
+
- name: Generate coverage report
|
|
37
|
+
if: matrix.node-version == '22.x'
|
|
38
|
+
run: npm run coverage
|
|
39
|
+
|
|
40
|
+
- name: Upload to coveralls
|
|
41
|
+
if: matrix.node-version == '22.x'
|
|
42
|
+
uses: coverallsapp/github-action@v2
|
|
43
|
+
with:
|
|
44
|
+
file: ./coverage.lcov
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
id-token: write
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
publish:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- uses: actions/setup-node@v4
|
|
18
|
+
with:
|
|
19
|
+
node-version: 24.x
|
|
20
|
+
registry-url: https://registry.npmjs.org
|
|
21
|
+
package-manager-cache: false
|
|
22
|
+
|
|
23
|
+
- run: npm ci
|
|
24
|
+
|
|
25
|
+
- name: Verify release version
|
|
26
|
+
run: |
|
|
27
|
+
PACKAGE_VERSION=$(node -p "require('./package.json').version")
|
|
28
|
+
test "$GITHUB_REF_NAME" = "v$PACKAGE_VERSION"
|
|
29
|
+
|
|
30
|
+
- run: npm run build
|
|
31
|
+
- run: npm test
|
|
32
|
+
- run: npm publish
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## v0.9.0 / 2026-07-20
|
|
4
|
+
### Added
|
|
5
|
+
- Modern and lite builds generated from the same source. #44
|
|
6
|
+
- support ESM.
|
|
7
|
+
- Set up GitHub release action / provenance
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
- Fix uploading coverage to coveralls
|
|
11
|
+
- fix recognize environment is node when use browserfs
|
|
12
|
+
|
|
13
|
+
## v0.8.3 / 2023-10-09
|
|
14
|
+
### Fixed
|
|
15
|
+
- package.json main property.
|
|
16
|
+
|
|
3
17
|
## v0.8.2 / 2023-10-09
|
|
4
18
|
### Remove
|
|
5
19
|
- package.json module property.
|
package/LICENSE.txt
CHANGED
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# js-md5
|
|
2
|
-
[](https://github.com/emn178/js-md5/actions/workflows/ci.yml)
|
|
3
3
|
[](https://coveralls.io/r/emn178/js-md5?branch=master)
|
|
4
4
|
[](https://nodei.co/npm/js-md5/)
|
|
5
5
|
|
|
@@ -10,12 +10,39 @@ A simple and fast MD5 hash function for JavaScript supports UTF-8 encoding.
|
|
|
10
10
|
[MD5 File Checksum Online](http://emn178.github.io/online-tools/md5_checksum.html)
|
|
11
11
|
|
|
12
12
|
## Download
|
|
13
|
-
[Compress](https://raw.github.com/emn178/js-md5/master/build/md5.min.js)
|
|
14
|
-
[
|
|
13
|
+
- [Compress](https://raw.github.com/emn178/js-md5/master/build/md5.min.js)
|
|
14
|
+
- [Uncompressed build](https://raw.github.com/emn178/js-md5/master/build/md5.js)
|
|
15
|
+
- [Modern](https://raw.github.com/emn178/js-md5/master/build/md5.modern.min.js)
|
|
16
|
+
- [Modern uncompressed](https://raw.github.com/emn178/js-md5/master/build/md5.modern.js)
|
|
17
|
+
- [Lite](https://raw.github.com/emn178/js-md5/master/build/md5-lite.min.js)
|
|
18
|
+
- [Lite uncompressed](https://raw.github.com/emn178/js-md5/master/build/md5-lite.js)
|
|
19
|
+
- [Uncompress](https://raw.github.com/emn178/js-md5/master/src/md5.js)
|
|
20
|
+
|
|
21
|
+
### Builds
|
|
22
|
+
|
|
23
|
+
| Build | Legacy fallbacks | Node acceleration | HMAC | Base64 | Deprecated `buffer` |
|
|
24
|
+
| --- | --- | --- | --- | --- | --- |
|
|
25
|
+
| `md5.js` / `md5.min.js` | Yes | Yes | Yes | Yes | Yes |
|
|
26
|
+
| `md5.modern.js` / `md5.modern.min.js` | No | Yes | Yes | Yes | Yes |
|
|
27
|
+
| `md5-lite.js` / `md5-lite.min.js` | No | No | No | No | No |
|
|
28
|
+
|
|
29
|
+
The modern and lite builds require `Array.isArray`, `ArrayBuffer`, typed arrays,
|
|
30
|
+
and `ArrayBuffer.isView`. The lite build keeps the one-shot and streaming MD5
|
|
31
|
+
APIs, including `hex`, `array`, `digest`, and `arrayBuffer` output.
|
|
15
32
|
|
|
16
33
|
## Benchmark
|
|
17
|
-
[
|
|
18
|
-
[
|
|
34
|
+
- [Benchmark (measurethat.net) - Short String](https://measurethat.net/Benchmarks/Show/29171/0/md5-performance-comparison-v2)
|
|
35
|
+
- [Benchmark (measurethat.net) - Long String](https://measurethat.net/Benchmarks/Show/29172/0/md5-performance-comparison-long-text-v2)
|
|
36
|
+
- [Benchmark (jsperf.app) - Long String](https://jsperf.app/jonuhi/6)
|
|
37
|
+
- [Benchmark (measurethat.net) - Very Long String](https://measurethat.net/Benchmarks/Show/29173/0/md5-performance-comparison-very-long-text)
|
|
38
|
+
- [Benchmark (jsperf.app) - Very Long String](https://jsperf.app/jonuhi/8)
|
|
39
|
+
- [Async Benchmark (measurethat.net)](https://measurethat.net/Benchmarks/Show/29176/0/md5-performance-comparison-very-long-text-v6)
|
|
40
|
+
- [Async Benchmark (jsperf.app)](https://jsperf.app/jonuhi/9)
|
|
41
|
+
|
|
42
|
+
* js-md5 is the fastest synchronous MD5 library, but slower than Hash-WASM
|
|
43
|
+
|
|
44
|
+
- [File Benchmark - Issue #19](https://github.com/emn178/js-md5/issues/19)
|
|
45
|
+
- [File Benchmark - Issue #42](https://github.com/emn178/js-md5/issues/42)
|
|
19
46
|
|
|
20
47
|
## Installation
|
|
21
48
|
You can also install js-md5 by using Bower.
|
|
@@ -85,7 +112,6 @@ md5.hex(''); // d41d8cd98f00b204e9800998ecf8427e
|
|
|
85
112
|
md5.array(''); // [212, 29, 140, 217, 143, 0, 178, 4, 233, 128, 9, 152, 236, 248, 66, 126]
|
|
86
113
|
md5.digest(''); // [212, 29, 140, 217, 143, 0, 178, 4, 233, 128, 9, 152, 236, 248, 66, 126]
|
|
87
114
|
md5.arrayBuffer(''); // ArrayBuffer
|
|
88
|
-
md5.buffer(''); // ArrayBuffer, deprecated, This maybe confuse with Buffer in node.js. Please use arrayBuffer instead.
|
|
89
115
|
md5.base64(''); // 1B2M2Y8AsgTpgAmY7PhCfg==
|
|
90
116
|
|
|
91
117
|
// HMAC
|