tinyhmacmd5 0.5.2-es2026 → 0.5.2

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 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 **905 Bytes**.
7
+ [`browser.min.js`](browser.min.js) is only **943 Bytes**.
8
8
 
9
9
  - **Input type**: `string` (UTF‑8), `Uint8Array` or `Uint8ClampedArray`
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@es2026
64
+ npm i tinyhmacmd5
65
65
  ```
66
66
 
67
67
  ```js
@@ -77,7 +77,7 @@ 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@es2026"></script>
80
+ <script src="https://cdn.jsdelivr.net/npm/tinyhmacmd5"></script>
81
81
  ```
82
82
 
83
83
  It will define the `md5` function using `var`.
@@ -85,7 +85,7 @@ It will define the `md5` function using `var`.
85
85
  ### UNPKG
86
86
 
87
87
  ```html
88
- <script src="https://unpkg.com/tinyhmacmd5@es2026"></script>
88
+ <script src="https://unpkg.com/tinyhmacmd5"></script>
89
89
  ```
90
90
 
91
91
  It will define the `md5` function using `var`.
@@ -178,22 +178,22 @@ md5(data)
178
178
 
179
179
  ## Runtime Environment
180
180
 
181
- Environments that support [`Uint8Array.prototype.toHex()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/toHex) :
181
+ Environments that support [Exponentiation (`**`)](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Exponentiation) and [`TextEncoder`](https://developer.mozilla.org/docs/Web/API/TextEncoder) :
182
182
 
183
183
  - Desktop
184
- - Chrome ≥ 140 (2025-09-02)
185
- - Edge ≥ 140 (2025-09-05)
186
- - Firefox ≥ 133 (2024-11-26)
187
- - Opera ≥ 124 (2025-11-13)
188
- - Safari ≥ 18.2 (2024-12-11)
184
+ - Chrome ≥ 52 (2016-07-20)
185
+ - Edge ≥ 79 (2020-01-15)
186
+ - Firefox ≥ 52 (2017-03-07)
187
+ - Opera ≥ 39 (2016-08-02)
188
+ - Safari ≥ 10.1 (2017-03-27)
189
189
  - Mobile
190
- - Chrome Android ≥ 140 (2025-09-02)
191
- - Firefox for Android ≥ 133 (2024-11-26)
192
- - Opera Android ≥ 92 (2025-10-08)
193
- - Safari on iOS ≥ 18.2 (2024-12-11)
194
- - Samsung Browser ×
195
- - WebView Android ≥ 140 (2025-09-02)
196
- - WebView on iOS ≥ 18.2 (2024-12-11)
190
+ - Chrome Android ≥ 52 (2016-07-27)
191
+ - Firefox for Android ≥ 52 (2017-03-07)
192
+ - Opera Android ≥ 41 (2016-10-25)
193
+ - Safari on iOS ≥ 10.3 (2017-03-27)
194
+ - Samsung Browser ≥ 6 (2017-08-23)
195
+ - WebView Android ≥ 51 (2016-06-08)
196
+ - WebView on iOS ≥ 10.3 (2017-03-27)
197
197
 
198
198
  Not recommended for use in environments that support `node:crypto`, as `node:crypto` already provides HMAC-MD5.
199
199
 
package/browser.min.js CHANGED
@@ -1 +1 @@
1
- {let e=Int32Array,r=Uint8Array,n=new e(64).map((e,r)=>2**32*Math.sin(++r%Math.PI)),t=1&new r(n.buffer)[0],f=e=>e.reverse(),o=(r,t,f=0,o=1732584193,a=271733878,l=e.of(o,~a,~o,a),w=r.length)=>{for(r[w-1]=t/2**29,r[(t-t%4)/4]|=128<<(r[w-2]=t<<3);f<w;f+=16){let{0:e,1:w,2:u,3:h}=l;for(t=o=0;t<16;t+=4)for(;o<4*t+16;w=0|((e+=n[o]+(u^(t>4?t>8?w|~h:w^h:t?h&(w^u):~w&(u^h)))+r[f+(o++*(29521>>t)+(1296>>t)&15)])<<a|e>>>32-a)+(e=h,h=u,u=w))a="',16%).4$+07&*/5".charCodeAt(3&o|t);l[0]+=e,l[1]+=w,l[2]+=u,l[3]+=h}return l},a=(n,o,a=("string"==typeof n?n=(new TextEncoder).encode(n):n).length,l=new e(o+18+(a-(a+8&63))/4),w=new r(l.buffer))=>(w.set(n,4*o),t&&f(w,f(l)),[l,a]);var md5=(n,l,w)=>{var u=null!=l,[h,s]=a(n,16*u);if(u){let[r,n]=a(l,0),t=new e(32),f=16;for(n>64&&(r=o(r,n));f;)t[--f]=1785358954^(h[f]=909522486^r[f]);t.set(o(h,64+s),16),h=t,s=80}return h=o(h,s),u=new r(h.buffer),t&&f(u,f(h)),w?u:u.toHex()}}
1
+ {let e=Int32Array,r=Uint8Array,n=new e(64).map((e,r)=>2**32*Math.sin(++r%Math.PI)),t=1&new r(n.buffer)[0],f=e=>e.reverse(),o=(r,t,f=0,o=1732584193,a=271733878,l=e.of(o,~a,~o,a),u=r.length)=>{for(r[u-1]=t/2**29,r[(t-t%4)/4]|=128<<(r[u-2]=t<<3);f<u;f+=16){let{0:e,1:u,2:w,3:d}=l;for(t=o=0;t<16;t+=4)for(;o<4*t+16;u=0|((e+=n[o]+(w^(t>4?t>8?u|~d:u^d:t?d&(u^w):~u&(w^d)))+r[f+(o++*(29521>>t)+(1296>>t)&15)])<<a|e>>>32-a)+(e=d,d=w,w=u))a="',16%).4$+07&*/5".charCodeAt(3&o|t);l[0]+=e,l[1]+=u,l[2]+=w,l[3]+=d}return l},a=(n,o,a=("string"==typeof n?n=(new TextEncoder).encode(n):n).length,l=new e(o+18+(a-(a+8&63))/4),u=new r(l.buffer))=>(u.set(n,4*o),t&&f(u,f(l)),[l,a]);var md5=(n,l,u)=>{var w=null!=l,[d,h]=a(n,16*w);if(w){let[r,n]=a(l,0),t=new e(32),f=16;for(n>64&&(r=o(r,n));f;)t[--f]=1785358954^(d[f]=909522486^r[f]);t.set(o(d,64+h),16),d=t,h=80}return d=o(d,h),w=new r(d.buffer),t&&f(w,f(d)),u?w:w.reduce((e,r)=>e+(r>>4&&"")+r.toString(16),"")}}
package/main.js CHANGED
@@ -144,7 +144,7 @@ let md5 = (data, key, raw) => {
144
144
  isBE && reverse(temp, reverse(bdata))
145
145
  return raw
146
146
  ? temp
147
- : temp.toHex()
147
+ : temp.reduce((p, v) => p + (v >> 4 && "") + v.toString(16), "")
148
148
  }
149
149
 
150
150
  export default md5
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tinyhmacmd5",
3
- "version": "0.5.2-es2026",
4
- "description": "A tiny (905 Bytes), fast and reliable implementation of MD5 and HMAC-MD5 for JavaScript.",
3
+ "version": "0.5.2",
4
+ "description": "A tiny (943 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 es2026 --module --checkFeatures main.js browser.min.js",
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",