tinyhmacmd5 0.5.3-es2026 → 0.5.3
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/README.md +17 -17
- package/browser.min.js +1 -1
- package/main.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ English | [中文](README-zh.md)
|
|
|
4
4
|
|
|
5
5
|
A tiny, fast and reliable implementation of MD5 and HMAC-MD5 for JavaScript.
|
|
6
6
|
|
|
7
|
-
[`browser.min.js`](browser.min.js) is only **
|
|
7
|
+
[`browser.min.js`](browser.min.js) is only **926 Bytes**.
|
|
8
8
|
|
|
9
9
|
- **Input type**: `string` (UTF‑8), `Uint8Array`, `Uint8ClampedArray`, `Int8Array` or `number[]`
|
|
10
10
|
- **Output type**: hex `string` or bytes `Uint8Array`
|
|
@@ -61,7 +61,7 @@ As a result, the final size is not the smallest theoretically achievable.
|
|
|
61
61
|
### npm
|
|
62
62
|
|
|
63
63
|
```
|
|
64
|
-
npm i tinyhmacmd5@
|
|
64
|
+
npm i tinyhmacmd5@latest
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
```js
|
|
@@ -77,13 +77,13 @@ You can also use other package managers (e.g. `pnpm` or `yarn`) in place of `npm
|
|
|
77
77
|
See https://www.jsdelivr.com/package/npm/tinyhmacmd5
|
|
78
78
|
|
|
79
79
|
```html
|
|
80
|
-
<script src="https://cdn.jsdelivr.net/npm/tinyhmacmd5
|
|
80
|
+
<script src="https://cdn.jsdelivr.net/npm/tinyhmacmd5"></script>
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
### UNPKG
|
|
84
84
|
|
|
85
85
|
```html
|
|
86
|
-
<script src="https://unpkg.com/tinyhmacmd5
|
|
86
|
+
<script src="https://unpkg.com/tinyhmacmd5"></script>
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
### cdnjs
|
|
@@ -177,22 +177,22 @@ md5([0, 1, 127, 255, -9])
|
|
|
177
177
|
|
|
178
178
|
## Runtime Environment
|
|
179
179
|
|
|
180
|
-
Environments that support [
|
|
180
|
+
Environments that support [Exponentiation (`**`)](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Exponentiation) and [`TextEncoder`](https://developer.mozilla.org/docs/Web/API/TextEncoder) :
|
|
181
181
|
|
|
182
182
|
- Desktop
|
|
183
|
-
- Chrome ≥
|
|
184
|
-
- Edge ≥
|
|
185
|
-
- Firefox ≥
|
|
186
|
-
- Opera ≥
|
|
187
|
-
- Safari ≥
|
|
183
|
+
- Chrome ≥ 52 (2016-07-20)
|
|
184
|
+
- Edge ≥ 79 (2020-01-15)
|
|
185
|
+
- Firefox ≥ 52 (2017-03-07)
|
|
186
|
+
- Opera ≥ 39 (2016-08-02)
|
|
187
|
+
- Safari ≥ 10.1 (2017-03-27)
|
|
188
188
|
- Mobile
|
|
189
|
-
- Chrome Android ≥
|
|
190
|
-
- Firefox for Android ≥
|
|
191
|
-
- Opera Android ≥
|
|
192
|
-
- Safari on iOS ≥
|
|
193
|
-
- Samsung Browser
|
|
194
|
-
- WebView Android ≥
|
|
195
|
-
- WebView on iOS ≥
|
|
189
|
+
- Chrome Android ≥ 52 (2016-07-27)
|
|
190
|
+
- Firefox for Android ≥ 52 (2017-03-07)
|
|
191
|
+
- Opera Android ≥ 41 (2016-10-25)
|
|
192
|
+
- Safari on iOS ≥ 10.3 (2017-03-27)
|
|
193
|
+
- Samsung Browser ≥ 6 (2017-08-23)
|
|
194
|
+
- WebView Android ≥ 51 (2016-06-08)
|
|
195
|
+
- WebView on iOS ≥ 10.3 (2017-03-27)
|
|
196
196
|
|
|
197
197
|
Not recommended for use in environments that support `node:crypto`, as `node:crypto` already provides HMAC-MD5.
|
|
198
198
|
|
package/browser.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{let e=Int32Array,r=Uint8Array,t=new e(64).map((e,r)=>2**32*Math.sin(++r%Math.PI)),n=1&new r(t.buffer)[0],f=e=>n?e.reverse():e,o=(r,n,f=0,o=1732584193,a=271733878,l=e.of(o,~a,~o,a),
|
|
1
|
+
{let e=Int32Array,r=Uint8Array,t=new e(64).map((e,r)=>2**32*Math.sin(++r%Math.PI)),n=1&new r(t.buffer)[0],f=e=>n?e.reverse():e,o=(r,n,f=0,o=1732584193,a=271733878,l=e.of(o,~a,~o,a),u=r.length)=>{for(r[u-1]=n/2**29,r[(n-n%4)/4]|=128<<(r[u-2]=n<<3);f<u;f+=16){let{0:e,1:u,2:w,3:d}=l;for(n=o=0;n<16;n+=4)for(let l=29521>>n,h=1296>>n;o<4*n+16;u=0|((e+=t[o]+(w^(n>4?n>8?u|~d:u^d:n?d&(u^w):~u&(w^d)))+r[f+(o++*l+h&15)])>>>a|e<<32-a)+(e=d,d=w,w=u))a="94/*;72,<50):61+".charCodeAt(3&o|n);l[0]+=e,l[1]+=u,l[2]+=w,l[3]+=d}return l},a=(t,n,o=("string"==typeof t?t=(new TextEncoder).encode(t):t).length,a=new r(n+o+72-(o+8&63)))=>[f(new e(a.buffer),a.set(t,n),f(a)),o];var md5=(t,n,l)=>{var u=null!=n,[w,d]=a(t,64*u);if(u){let[r,t]=a(n,0),f=new e(32);for(t>64&&(r=o(r,t)),t=16;t;)f[--t]=1785358954^(w[t]=909522486^r[t]);f.set(o(w,64+d),16),w=f,d=80}return u=f(new r(f(o(w,d)).buffer)),l?u:u.reduce((e,r)=>e+(r>>4&&"")+r.toString(16),"")}}
|
package/main.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinyhmacmd5",
|
|
3
|
-
"version": "0.5.3
|
|
4
|
-
"description": "A tiny (
|
|
3
|
+
"version": "0.5.3",
|
|
4
|
+
"description": "A tiny (926 Bytes), fast and reliable implementation of MD5 and HMAC-MD5 for JavaScript.",
|
|
5
5
|
"author": "bddjr",
|
|
6
6
|
"license": "Unlicense",
|
|
7
7
|
"type": "module",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"typescript": "^7.0.2"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
|
-
"build": "tsc && node scripts/build.mjs && es-check
|
|
67
|
+
"build": "tsc && node scripts/build.mjs && es-check es2016 --module --checkFeatures main.js browser.min.js",
|
|
68
68
|
"build:unchanged": "node scripts/build-unchanged.mjs",
|
|
69
69
|
"test": "pnpm build && pnpm test:only",
|
|
70
70
|
"test:only": "node scripts/test.mjs && node scripts/test-513MiB.mjs",
|