pure-md5 0.2.0 → 0.2.1

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.
Files changed (158) hide show
  1. package/dist/adapters/ie11.cjs +1 -2
  2. package/dist/adapters/ie11.js +1 -2
  3. package/dist/adapters/node.cjs +1 -2
  4. package/dist/adapters/node.js +1 -2
  5. package/dist/adapters/webcrypto.cjs +1 -2
  6. package/dist/adapters/webcrypto.js +1 -2
  7. package/dist/core/index.cjs +1 -2
  8. package/dist/core/index.js +1 -2
  9. package/dist/index.cjs +1 -2
  10. package/dist/index.js +1 -2
  11. package/dist/stream/adapter.cjs +1 -2
  12. package/dist/stream/adapter.js +1 -2
  13. package/dist/stream/fs-utils.cjs +1 -2
  14. package/dist/stream/fs-utils.js +1 -2
  15. package/dist/stream/index.cjs +1 -2
  16. package/dist/stream/index.js +1 -2
  17. package/dist/stream/light/index.cjs +1 -2
  18. package/dist/stream/light/index.js +1 -2
  19. package/dist/stream/md5-stream.cjs +1 -2
  20. package/dist/stream/md5-stream.js +1 -2
  21. package/dist/stream/whatwg-stream.cjs +1 -2
  22. package/dist/stream/whatwg-stream.js +1 -2
  23. package/dist/utils/detect.cjs +1 -2
  24. package/dist/utils/detect.js +1 -2
  25. package/package.json +1 -1
  26. package/pure-md5-0.2.0.tgz +0 -0
  27. package/.aliases +0 -19
  28. package/.bash_profile +0 -12
  29. package/.bash_prompt +0 -56
  30. package/.changeset/README.md +0 -32
  31. package/.changeset/config.json +0 -16
  32. package/.continue/mcpServers/new-mcp-server.yaml +0 -10
  33. package/.continue/rules +0 -29
  34. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -35
  35. package/.github/ISSUE_TEMPLATE/documentation.md +0 -20
  36. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  37. package/.github/PULL_REQUEST_TEMPLATE.md +0 -35
  38. package/.github/workflows/npm-publish.yml +0 -33
  39. package/.github/workflows/release.yml +0 -42
  40. package/CHANGELOG.md +0 -9
  41. package/CONTRIBUTING.md +0 -203
  42. package/MIGRATION_GUIDE_STREAMS.md +0 -374
  43. package/STREAM_API.md +0 -582
  44. package/STREAM_BENCHMARKS.md +0 -232
  45. package/STREAM_EXAMPLES.md +0 -669
  46. package/STREAM_OPTIMIZATION_REPORT.md +0 -136
  47. package/STREAM_TROUBLESHOOTING.md +0 -537
  48. package/WEB_CRYPTO_TESTS_SUMMARY.md +0 -140
  49. package/WHATWG_STREAMS.md +0 -191
  50. package/__tests__/adapters/node-crypto.test.ts +0 -167
  51. package/__tests__/adapters/web-crypto-node.test.ts +0 -73
  52. package/__tests__/adapters/web-crypto.test.ts +0 -195
  53. package/__tests__/add32.test.ts +0 -33
  54. package/__tests__/fallback.test.ts +0 -345
  55. package/__tests__/hex.test.ts +0 -38
  56. package/__tests__/hex_chr.test.ts +0 -20
  57. package/__tests__/index.test.ts +0 -87
  58. package/__tests__/integration/fixtures/test-file.txt +0 -1
  59. package/__tests__/integration/md5-stream-file.test.ts +0 -293
  60. package/__tests__/integration/node-crypto-file.test.ts +0 -86
  61. package/__tests__/integration/web-crypto.test.ts +0 -38
  62. package/__tests__/md51.test.ts +0 -73
  63. package/__tests__/md5block.test.ts +0 -61
  64. package/__tests__/md5cycle.test.ts +0 -48
  65. package/__tests__/round-functions.test.ts +0 -87
  66. package/__tests__/stream/fs-utils.test.ts +0 -209
  67. package/__tests__/stream/md5-stream-edge-cases.test.ts +0 -461
  68. package/__tests__/stream/md5-stream.test.ts +0 -418
  69. package/__tests__/stream/whatwg-stream.test.ts +0 -355
  70. package/__tests__/stream/whatwg-stream.test.ts.bak2 +0 -335
  71. package/benchmarks/md5-stream.bench.ts +0 -212
  72. package/benchmarks/whatwg-stream.bench.ts +0 -180
  73. package/dist/adapters/ie11.cjs.map +0 -1
  74. package/dist/adapters/ie11.js.map +0 -1
  75. package/dist/adapters/node.cjs.map +0 -1
  76. package/dist/adapters/node.js.map +0 -1
  77. package/dist/adapters/webcrypto.cjs.map +0 -1
  78. package/dist/adapters/webcrypto.js.map +0 -1
  79. package/dist/chunk-2YXXFGBV.js +0 -2
  80. package/dist/chunk-2YXXFGBV.js.map +0 -1
  81. package/dist/chunk-4KSCMS4Q.js +0 -2
  82. package/dist/chunk-4KSCMS4Q.js.map +0 -1
  83. package/dist/chunk-6P2QV5SR.js +0 -4
  84. package/dist/chunk-6P2QV5SR.js.map +0 -1
  85. package/dist/chunk-G5WHEAIQ.js +0 -2
  86. package/dist/chunk-G5WHEAIQ.js.map +0 -1
  87. package/dist/chunk-H2K353LR.js +0 -2
  88. package/dist/chunk-H2K353LR.js.map +0 -1
  89. package/dist/chunk-JKVD5LHZ.js +0 -2
  90. package/dist/chunk-JKVD5LHZ.js.map +0 -1
  91. package/dist/chunk-NWQ4N5RX.js +0 -2
  92. package/dist/chunk-NWQ4N5RX.js.map +0 -1
  93. package/dist/chunk-PHZ7FTYF.js +0 -2
  94. package/dist/chunk-PHZ7FTYF.js.map +0 -1
  95. package/dist/chunk-PNZTVQA7.js +0 -2
  96. package/dist/chunk-PNZTVQA7.js.map +0 -1
  97. package/dist/chunk-R4JB5MBR.js +0 -2
  98. package/dist/chunk-R4JB5MBR.js.map +0 -1
  99. package/dist/chunk-VFOAY6XI.js +0 -2
  100. package/dist/chunk-VFOAY6XI.js.map +0 -1
  101. package/dist/chunk-XB5BQIEX.js +0 -2
  102. package/dist/chunk-XB5BQIEX.js.map +0 -1
  103. package/dist/core/index.cjs.map +0 -1
  104. package/dist/core/index.js.map +0 -1
  105. package/dist/index.cjs.map +0 -1
  106. package/dist/index.js.map +0 -1
  107. package/dist/stream/adapter.cjs.map +0 -1
  108. package/dist/stream/adapter.js.map +0 -1
  109. package/dist/stream/fs-utils.cjs.map +0 -1
  110. package/dist/stream/fs-utils.js.map +0 -1
  111. package/dist/stream/index.cjs.map +0 -1
  112. package/dist/stream/index.js.map +0 -1
  113. package/dist/stream/light/index.cjs.map +0 -1
  114. package/dist/stream/light/index.js.map +0 -1
  115. package/dist/stream/md5-stream.cjs.map +0 -1
  116. package/dist/stream/md5-stream.js.map +0 -1
  117. package/dist/stream/whatwg-stream.cjs.map +0 -1
  118. package/dist/stream/whatwg-stream.js.map +0 -1
  119. package/dist/utils/detect.cjs.map +0 -1
  120. package/dist/utils/detect.js.map +0 -1
  121. package/planning/03-optimization-size-tree-shaking/01-es-modules-tree-shaking.md +0 -152
  122. package/planning/03-optimization-size-tree-shaking/02-consolidate-modules.md +0 -65
  123. package/planning/03-optimization-size-tree-shaking/03-remove-duplicate-add32.md +0 -93
  124. package/planning/03-optimization-size-tree-shaking/04-remove-runtime-check.md +0 -102
  125. package/planning/03-optimization-size-tree-shaking/05-optimize-loops-performance.md +0 -107
  126. package/planning/03-optimization-size-tree-shaking/06-tsup-formats-configuration.md +0 -227
  127. package/planning/03-optimization-size-tree-shaking/07-multiple-build-formats.md +0 -228
  128. package/planning/03-optimization-size-tree-shaking/08-benchmarks-metrics.md +0 -34
  129. package/planning/03-optimization-size-tree-shaking/MIGRATION_GUIDE.md +0 -260
  130. package/planning/03-optimization-size-tree-shaking/README.md +0 -173
  131. package/planning/03-optimization-size-tree-shaking/SUMMARY.md +0 -168
  132. package/planning/04-adapter-backend/03-backend-web-crypto.md +0 -149
  133. package/planning/04-adapter-backend/04-backend-node-crypto.md +0 -181
  134. package/planning/04-adapter-backend/05-backend-pure-js.md +0 -174
  135. package/planning/04-adapter-backend/06-backend-ie11.md +0 -158
  136. package/planning/04-adapter-backend/07-detection-environment.md +0 -232
  137. package/planning/04-adapter-backend/08-detection-backend.md +0 -210
  138. package/planning/04-adapter-backend/09-adapter-unified.md +0 -255
  139. package/planning/04-adapter-backend/10-fallback-mechanism.md +0 -333
  140. package/planning/04-adapter-backend/11-tests-backend-web-crypto.md +0 -191
  141. package/planning/04-adapter-backend/12-tests-backend-node-crypto.md +0 -222
  142. package/planning/04-adapter-backend/README.md +0 -45
  143. package/planning/05-documentation-publishing/01-README-optimization.md +0 -105
  144. package/planning/05-documentation-publishing/02-VitePress-site-evaluation.md +0 -136
  145. package/planning/05-documentation-publishing/03-Changeset-setup.md +0 -192
  146. package/planning/05-documentation-publishing/04-GitHub-templates.md +0 -252
  147. package/planning/05-documentation-publishing/README.md +0 -22
  148. package/planning/05-documentation-publishing/STATUS.md +0 -222
  149. package/planning/prd.md +0 -405
  150. package/planning/streams/01-create-md5stream-class.md +0 -69
  151. package/planning/streams/02-create-factory-api.md +0 -65
  152. package/planning/streams/03-fs-integration.md +0 -37
  153. package/planning/streams/04-whatwg-streams-support.md +0 -37
  154. package/planning/streams/05-audit-optimization.md +0 -121
  155. package/planning/streams/06-comprehensive-tests-docs.md +0 -137
  156. package/planning/streams/07-architecture-integration.md +0 -38
  157. package/planning/streams/README.md +0 -98
  158. package/tsup.config.ts +0 -24
@@ -1,2 +1 @@
1
- 'use strict';var n=class{constructor(){this.name="ie11";this.version="1.0.0";}static isAvailable(){if(typeof window>"u")return false;let r=window;return typeof r.msCrypto<"u"&&typeof r.msCrypto.subtle<"u"&&typeof r.msCrypto.subtle.digest=="function"}async hash(r){let e=new TextEncoder().encode(r);return await this.hashBinary(e)}async hashBinary(r){let t=window,e=r instanceof Uint8Array?r.buffer:r,i=await t.msCrypto.subtle.digest("MD5",e);return this.bufferToHex(i)}bufferToHex(r){return Array.from(new Uint8Array(r)).map(t=>t.toString(16).padStart(2,"0")).join("")}update(r){throw new Error("msCrypto does not support streaming updates")}digest(r){throw new Error("msCrypto does not support streaming")}reset(){}};exports.IE11Backend=n;//# sourceMappingURL=ie11.cjs.map
2
- //# sourceMappingURL=ie11.cjs.map
1
+ 'use strict';var n=class{constructor(){this.name="ie11";this.version="1.0.0";}static isAvailable(){if(typeof window>"u")return false;let r=window;return typeof r.msCrypto<"u"&&typeof r.msCrypto.subtle<"u"&&typeof r.msCrypto.subtle.digest=="function"}async hash(r){let e=new TextEncoder().encode(r);return await this.hashBinary(e)}async hashBinary(r){let t=window,e=r instanceof Uint8Array?r.buffer:r,i=await t.msCrypto.subtle.digest("MD5",e);return this.bufferToHex(i)}bufferToHex(r){return Array.from(new Uint8Array(r)).map(t=>t.toString(16).padStart(2,"0")).join("")}update(r){throw new Error("msCrypto does not support streaming updates")}digest(r){throw new Error("msCrypto does not support streaming")}reset(){}};exports.IE11Backend=n;
@@ -1,2 +1 @@
1
- export{a as IE11Backend}from'../chunk-VFOAY6XI.js';import'../chunk-2YXXFGBV.js';//# sourceMappingURL=ie11.js.map
2
- //# sourceMappingURL=ie11.js.map
1
+ export{a as IE11Backend}from'../chunk-QB6MF5LD.js';import'../chunk-I7AUKTXE.js';
@@ -1,2 +1 @@
1
- 'use strict';var n=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(r,t)=>(typeof require<"u"?require:r)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var i=class{constructor(){this.name="nodecrypto";this.version="1.0.0";}static isAvailable(){try{return typeof n("crypto").createHash=="function"}catch{return false}}hash(r){return n("crypto").createHash("md5").update(r).digest("hex")}async hashBinary(r){let t=n("crypto"),o=r instanceof Uint8Array?r:new Uint8Array(r);return t.createHash("md5").update(o).digest("hex")}update(r){}digest(r){throw new Error("Node crypto streaming not implemented")}reset(){}};exports.NodeCryptoBackend=i;//# sourceMappingURL=node.cjs.map
2
- //# sourceMappingURL=node.cjs.map
1
+ 'use strict';var n=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(r,t)=>(typeof require<"u"?require:r)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var i=class{constructor(){this.name="nodecrypto";this.version="1.0.0";}static isAvailable(){try{return typeof n("crypto").createHash=="function"}catch{return false}}hash(r){return n("crypto").createHash("md5").update(r).digest("hex")}async hashBinary(r){let t=n("crypto"),o=r instanceof Uint8Array?r:new Uint8Array(r);return t.createHash("md5").update(o).digest("hex")}update(r){}digest(r){throw new Error("Node crypto streaming not implemented")}reset(){}};exports.NodeCryptoBackend=i;
@@ -1,2 +1 @@
1
- export{a as NodeCryptoBackend}from'../chunk-PNZTVQA7.js';import'../chunk-2YXXFGBV.js';//# sourceMappingURL=node.js.map
2
- //# sourceMappingURL=node.js.map
1
+ export{a as NodeCryptoBackend}from'../chunk-XPYPJSJE.js';import'../chunk-I7AUKTXE.js';
@@ -1,2 +1 @@
1
- 'use strict';var C="0123456789abcdef".split(""),p=C;function B(o){let n="";for(let m=0;m<4;m++)n+=p[o>>m*8+4&15]+p[o>>m*8&15];return n}function P(o){let n=o.length,m=new Array(n);for(let e=0;e<n;e++)m[e]=B(o[e]);return m.join("")}var g=P;function D(o,n){return o+n&4294967295}var c=D;function U(o,n,m,e,r){let t=r||c;return n=t(t(n,o),t(m,e)),n}function _(o,n,m,e){var t=(e||c)(o<<n|o>>>32-n,m);return t}function s(o,n,m,e,r,t,u){return n=U(o,n,e,t,u),_(n,r,m,u)}function h(o,n,m,e,r,t,u,i){return s(m&e|~m&r,n,m,t,u,i,o)}function y(o,n,m,e,r,t,u,i){return s(m&r|e&~r,n,m,t,u,i,o)}function A(o,n,m,e,r,t,u,i){return s(m^e^r,n,m,t,u,i,o)}function x(o,n,m,e,r,t,u,i){return s(e^(m|~r),n,m,t,u,i,o)}function j(o,n,m){typeof m>"u"&&(m=c);let e=o[0],r=o[1],t=o[2],u=o[3],i=h.bind(null,m);e=i(e,r,t,u,n[0],7,-680876936),u=i(u,e,r,t,n[1],12,-389564586),t=i(t,u,e,r,n[2],17,606105819),r=i(r,t,u,e,n[3],22,-1044525330),e=i(e,r,t,u,n[4],7,-176418897),u=i(u,e,r,t,n[5],12,1200080426),t=i(t,u,e,r,n[6],17,-1473231341),r=i(r,t,u,e,n[7],22,-45705983),e=i(e,r,t,u,n[8],7,1770035416),u=i(u,e,r,t,n[9],12,-1958414417),t=i(t,u,e,r,n[10],17,-42063),r=i(r,t,u,e,n[11],22,-1990404162),e=i(e,r,t,u,n[12],7,1804603682),u=i(u,e,r,t,n[13],12,-40341101),t=i(t,u,e,r,n[14],17,-1502002290),r=i(r,t,u,e,n[15],22,1236535329);let d=y.bind(null,m);e=d(e,r,t,u,n[1],5,-165796510),u=d(u,e,r,t,n[6],9,-1069501632),t=d(t,u,e,r,n[11],14,643717713),r=d(r,t,u,e,n[0],20,-373897302),e=d(e,r,t,u,n[5],5,-701558691),u=d(u,e,r,t,n[10],9,38016083),t=d(t,u,e,r,n[15],14,-660478335),r=d(r,t,u,e,n[4],20,-405537848),e=d(e,r,t,u,n[9],5,568446438),u=d(u,e,r,t,n[14],9,-1019803690),t=d(t,u,e,r,n[3],14,-187363961),r=d(r,t,u,e,n[8],20,1163531501),e=d(e,r,t,u,n[13],5,-1444681467),u=d(u,e,r,t,n[2],9,-51403784),t=d(t,u,e,r,n[7],14,1735328473),r=d(r,t,u,e,n[12],20,-1926607734);let b=A.bind(null,m);e=b(e,r,t,u,n[5],4,-378558),u=b(u,e,r,t,n[8],11,-2022574463),t=b(t,u,e,r,n[11],16,1839030562),r=b(r,t,u,e,n[14],23,-35309556),e=b(e,r,t,u,n[1],4,-1530992060),u=b(u,e,r,t,n[4],11,1272893353),t=b(t,u,e,r,n[7],16,-155497632),r=b(r,t,u,e,n[10],23,-1094730640),e=b(e,r,t,u,n[13],4,681279174),u=b(u,e,r,t,n[0],11,-358537222),t=b(t,u,e,r,n[3],16,-722521979),r=b(r,t,u,e,n[6],23,76029189),e=b(e,r,t,u,n[9],4,-640364487),u=b(u,e,r,t,n[12],11,-421815835),t=b(t,u,e,r,n[15],16,530742520),r=b(r,t,u,e,n[2],23,-995338651);let f=x.bind(null,m);e=f(e,r,t,u,n[0],6,-198630844),u=f(u,e,r,t,n[7],10,1126891415),t=f(t,u,e,r,n[14],15,-1416354905),r=f(r,t,u,e,n[5],21,-57434055),e=f(e,r,t,u,n[12],6,1700485571),u=f(u,e,r,t,n[3],10,-1894986606),t=f(t,u,e,r,n[10],15,-1051523),r=f(r,t,u,e,n[1],21,-2054922799),e=f(e,r,t,u,n[8],6,1873313359),u=f(u,e,r,t,n[15],10,-30611744),t=f(t,u,e,r,n[6],15,-1560198380),r=f(r,t,u,e,n[13],21,1309151649),e=f(e,r,t,u,n[4],6,-145523070),u=f(u,e,r,t,n[11],10,-1120210379),t=f(t,u,e,r,n[2],15,718787259),r=f(r,t,u,e,n[9],21,-343485551),o[0]=m(e,o[0]),o[1]=m(r,o[1]),o[2]=m(t,o[2]),o[3]=m(u,o[3]);}var l=j;function E(o){let n=[];for(let m=0;m<64;m+=4)n[m>>2]=(o.charCodeAt(m)||0)+((o.charCodeAt(m+1)||0)<<8)+((o.charCodeAt(m+2)||0)<<16)+((o.charCodeAt(m+3)||0)<<24);return n}var F=E;function I(o,n){let m=o.length,e=[1732584193,-271733879,-1732584194,271733878],r;for(r=64;r<=m;r+=64)l(e,F(o.substring(r-64,r)),n);o=o.substring(r-64);var t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=o.length;for(r=0;r<u;r++)t[r>>2]|=(o.charCodeAt(r)&255)<<(r%4<<3);if(t[r>>2]|=128<<(r%4<<3),r>55)for(l(e,t,n),r=16;r--;)t[r]=0;return t[14]=m*8,l(e,t,n),e}var v=I;function a(o){return g(v(o,c))}var w=class{constructor(){this.name="webcrypto";this.version="1.0.0";}static isAvailable(){return typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof crypto.subtle.digest=="function"}async hash(n){return a(n)}async hashBinary(n){let m=n instanceof ArrayBuffer?new TextDecoder().decode(n):new TextDecoder().decode(n);return a(m)}update(n){throw new Error("Web Crypto API does not support streaming updates")}digest(n){throw new Error("Web Crypto API does not support streaming")}reset(){}};exports.WebCryptoBackend=w;//# sourceMappingURL=webcrypto.cjs.map
2
- //# sourceMappingURL=webcrypto.cjs.map
1
+ 'use strict';var C="0123456789abcdef".split(""),p=C;function B(o){let n="";for(let m=0;m<4;m++)n+=p[o>>m*8+4&15]+p[o>>m*8&15];return n}function P(o){let n=o.length,m=new Array(n);for(let e=0;e<n;e++)m[e]=B(o[e]);return m.join("")}var g=P;function D(o,n){return o+n&4294967295}var c=D;function U(o,n,m,e,r){let t=r||c;return n=t(t(n,o),t(m,e)),n}function _(o,n,m,e){var t=(e||c)(o<<n|o>>>32-n,m);return t}function s(o,n,m,e,r,t,u){return n=U(o,n,e,t,u),_(n,r,m,u)}function h(o,n,m,e,r,t,u,i){return s(m&e|~m&r,n,m,t,u,i,o)}function y(o,n,m,e,r,t,u,i){return s(m&r|e&~r,n,m,t,u,i,o)}function A(o,n,m,e,r,t,u,i){return s(m^e^r,n,m,t,u,i,o)}function x(o,n,m,e,r,t,u,i){return s(e^(m|~r),n,m,t,u,i,o)}function j(o,n,m){typeof m>"u"&&(m=c);let e=o[0],r=o[1],t=o[2],u=o[3],i=h.bind(null,m);e=i(e,r,t,u,n[0],7,-680876936),u=i(u,e,r,t,n[1],12,-389564586),t=i(t,u,e,r,n[2],17,606105819),r=i(r,t,u,e,n[3],22,-1044525330),e=i(e,r,t,u,n[4],7,-176418897),u=i(u,e,r,t,n[5],12,1200080426),t=i(t,u,e,r,n[6],17,-1473231341),r=i(r,t,u,e,n[7],22,-45705983),e=i(e,r,t,u,n[8],7,1770035416),u=i(u,e,r,t,n[9],12,-1958414417),t=i(t,u,e,r,n[10],17,-42063),r=i(r,t,u,e,n[11],22,-1990404162),e=i(e,r,t,u,n[12],7,1804603682),u=i(u,e,r,t,n[13],12,-40341101),t=i(t,u,e,r,n[14],17,-1502002290),r=i(r,t,u,e,n[15],22,1236535329);let d=y.bind(null,m);e=d(e,r,t,u,n[1],5,-165796510),u=d(u,e,r,t,n[6],9,-1069501632),t=d(t,u,e,r,n[11],14,643717713),r=d(r,t,u,e,n[0],20,-373897302),e=d(e,r,t,u,n[5],5,-701558691),u=d(u,e,r,t,n[10],9,38016083),t=d(t,u,e,r,n[15],14,-660478335),r=d(r,t,u,e,n[4],20,-405537848),e=d(e,r,t,u,n[9],5,568446438),u=d(u,e,r,t,n[14],9,-1019803690),t=d(t,u,e,r,n[3],14,-187363961),r=d(r,t,u,e,n[8],20,1163531501),e=d(e,r,t,u,n[13],5,-1444681467),u=d(u,e,r,t,n[2],9,-51403784),t=d(t,u,e,r,n[7],14,1735328473),r=d(r,t,u,e,n[12],20,-1926607734);let b=A.bind(null,m);e=b(e,r,t,u,n[5],4,-378558),u=b(u,e,r,t,n[8],11,-2022574463),t=b(t,u,e,r,n[11],16,1839030562),r=b(r,t,u,e,n[14],23,-35309556),e=b(e,r,t,u,n[1],4,-1530992060),u=b(u,e,r,t,n[4],11,1272893353),t=b(t,u,e,r,n[7],16,-155497632),r=b(r,t,u,e,n[10],23,-1094730640),e=b(e,r,t,u,n[13],4,681279174),u=b(u,e,r,t,n[0],11,-358537222),t=b(t,u,e,r,n[3],16,-722521979),r=b(r,t,u,e,n[6],23,76029189),e=b(e,r,t,u,n[9],4,-640364487),u=b(u,e,r,t,n[12],11,-421815835),t=b(t,u,e,r,n[15],16,530742520),r=b(r,t,u,e,n[2],23,-995338651);let f=x.bind(null,m);e=f(e,r,t,u,n[0],6,-198630844),u=f(u,e,r,t,n[7],10,1126891415),t=f(t,u,e,r,n[14],15,-1416354905),r=f(r,t,u,e,n[5],21,-57434055),e=f(e,r,t,u,n[12],6,1700485571),u=f(u,e,r,t,n[3],10,-1894986606),t=f(t,u,e,r,n[10],15,-1051523),r=f(r,t,u,e,n[1],21,-2054922799),e=f(e,r,t,u,n[8],6,1873313359),u=f(u,e,r,t,n[15],10,-30611744),t=f(t,u,e,r,n[6],15,-1560198380),r=f(r,t,u,e,n[13],21,1309151649),e=f(e,r,t,u,n[4],6,-145523070),u=f(u,e,r,t,n[11],10,-1120210379),t=f(t,u,e,r,n[2],15,718787259),r=f(r,t,u,e,n[9],21,-343485551),o[0]=m(e,o[0]),o[1]=m(r,o[1]),o[2]=m(t,o[2]),o[3]=m(u,o[3]);}var l=j;function E(o){let n=[];for(let m=0;m<64;m+=4)n[m>>2]=(o.charCodeAt(m)||0)+((o.charCodeAt(m+1)||0)<<8)+((o.charCodeAt(m+2)||0)<<16)+((o.charCodeAt(m+3)||0)<<24);return n}var F=E;function I(o,n){let m=o.length,e=[1732584193,-271733879,-1732584194,271733878],r;for(r=64;r<=m;r+=64)l(e,F(o.substring(r-64,r)),n);o=o.substring(r-64);var t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=o.length;for(r=0;r<u;r++)t[r>>2]|=(o.charCodeAt(r)&255)<<(r%4<<3);if(t[r>>2]|=128<<(r%4<<3),r>55)for(l(e,t,n),r=16;r--;)t[r]=0;return t[14]=m*8,l(e,t,n),e}var v=I;function a(o){return g(v(o,c))}var w=class{constructor(){this.name="webcrypto";this.version="1.0.0";}static isAvailable(){return typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof crypto.subtle.digest=="function"}async hash(n){return a(n)}async hashBinary(n){let m=n instanceof ArrayBuffer?new TextDecoder().decode(n):new TextDecoder().decode(n);return a(m)}update(n){throw new Error("Web Crypto API does not support streaming updates")}digest(n){throw new Error("Web Crypto API does not support streaming")}reset(){}};exports.WebCryptoBackend=w;
@@ -1,2 +1 @@
1
- export{a as WebCryptoBackend}from'../chunk-G5WHEAIQ.js';import'../chunk-NWQ4N5RX.js';import'../chunk-R4JB5MBR.js';import'../chunk-2YXXFGBV.js';//# sourceMappingURL=webcrypto.js.map
2
- //# sourceMappingURL=webcrypto.js.map
1
+ export{a as WebCryptoBackend}from'../chunk-43QQAXLT.js';import'../chunk-Z4JB6DTM.js';import'../chunk-DFR4GYL3.js';import'../chunk-I7AUKTXE.js';
@@ -1,2 +1 @@
1
- 'use strict';var B="0123456789abcdef".split(""),s=B;function j(m){let t="";for(let o=0;o<4;o++)t+=s[m>>o*8+4&15]+s[m>>o*8&15];return t}function v(m){let t=m.length,o=new Array(t);for(let r=0;r<t;r++)o[r]=j(m[r]);return o.join("")}var h=v;function w(m,t){return m+t&4294967295}var f=w;function _(m,t,o,r,n){let e=n||f;return t=e(e(t,m),e(o,r)),t}function q(m,t,o,r){var e=(r||f)(m<<t|m>>>32-t,o);return e}function p(m,t,o,r,n,e,u){return t=_(m,t,r,e,u),q(t,n,o,u)}function g(m,t,o,r,n,e,u,i){return p(o&r|~o&n,t,o,e,u,i,m)}function a(m,t,o,r,n,e,u,i){return p(o&n|r&~n,t,o,e,u,i,m)}function A(m,t,o,r,n,e,u,i){return p(o^r^n,t,o,e,u,i,m)}function x(m,t,o,r,n,e,u,i){return p(r^(o|~n),t,o,e,u,i,m)}function z(m,t,o){typeof o>"u"&&(o=f);let r=m[0],n=m[1],e=m[2],u=m[3],i=g.bind(null,o);r=i(r,n,e,u,t[0],7,-680876936),u=i(u,r,n,e,t[1],12,-389564586),e=i(e,u,r,n,t[2],17,606105819),n=i(n,e,u,r,t[3],22,-1044525330),r=i(r,n,e,u,t[4],7,-176418897),u=i(u,r,n,e,t[5],12,1200080426),e=i(e,u,r,n,t[6],17,-1473231341),n=i(n,e,u,r,t[7],22,-45705983),r=i(r,n,e,u,t[8],7,1770035416),u=i(u,r,n,e,t[9],12,-1958414417),e=i(e,u,r,n,t[10],17,-42063),n=i(n,e,u,r,t[11],22,-1990404162),r=i(r,n,e,u,t[12],7,1804603682),u=i(u,r,n,e,t[13],12,-40341101),e=i(e,u,r,n,t[14],17,-1502002290),n=i(n,e,u,r,t[15],22,1236535329);let b=a.bind(null,o);r=b(r,n,e,u,t[1],5,-165796510),u=b(u,r,n,e,t[6],9,-1069501632),e=b(e,u,r,n,t[11],14,643717713),n=b(n,e,u,r,t[0],20,-373897302),r=b(r,n,e,u,t[5],5,-701558691),u=b(u,r,n,e,t[10],9,38016083),e=b(e,u,r,n,t[15],14,-660478335),n=b(n,e,u,r,t[4],20,-405537848),r=b(r,n,e,u,t[9],5,568446438),u=b(u,r,n,e,t[14],9,-1019803690),e=b(e,u,r,n,t[3],14,-187363961),n=b(n,e,u,r,t[8],20,1163531501),r=b(r,n,e,u,t[13],5,-1444681467),u=b(u,r,n,e,t[2],9,-51403784),e=b(e,u,r,n,t[7],14,1735328473),n=b(n,e,u,r,t[12],20,-1926607734);let c=A.bind(null,o);r=c(r,n,e,u,t[5],4,-378558),u=c(u,r,n,e,t[8],11,-2022574463),e=c(e,u,r,n,t[11],16,1839030562),n=c(n,e,u,r,t[14],23,-35309556),r=c(r,n,e,u,t[1],4,-1530992060),u=c(u,r,n,e,t[4],11,1272893353),e=c(e,u,r,n,t[7],16,-155497632),n=c(n,e,u,r,t[10],23,-1094730640),r=c(r,n,e,u,t[13],4,681279174),u=c(u,r,n,e,t[0],11,-358537222),e=c(e,u,r,n,t[3],16,-722521979),n=c(n,e,u,r,t[6],23,76029189),r=c(r,n,e,u,t[9],4,-640364487),u=c(u,r,n,e,t[12],11,-421815835),e=c(e,u,r,n,t[15],16,530742520),n=c(n,e,u,r,t[2],23,-995338651);let d=x.bind(null,o);r=d(r,n,e,u,t[0],6,-198630844),u=d(u,r,n,e,t[7],10,1126891415),e=d(e,u,r,n,t[14],15,-1416354905),n=d(n,e,u,r,t[5],21,-57434055),r=d(r,n,e,u,t[12],6,1700485571),u=d(u,r,n,e,t[3],10,-1894986606),e=d(e,u,r,n,t[10],15,-1051523),n=d(n,e,u,r,t[1],21,-2054922799),r=d(r,n,e,u,t[8],6,1873313359),u=d(u,r,n,e,t[15],10,-30611744),e=d(e,u,r,n,t[6],15,-1560198380),n=d(n,e,u,r,t[13],21,1309151649),r=d(r,n,e,u,t[4],6,-145523070),u=d(u,r,n,e,t[11],10,-1120210379),e=d(e,u,r,n,t[2],15,718787259),n=d(n,e,u,r,t[9],21,-343485551),m[0]=o(r,m[0]),m[1]=o(n,m[1]),m[2]=o(e,m[2]),m[3]=o(u,m[3]);}var l=z;function D(m){let t=[];for(let o=0;o<64;o+=4)t[o>>2]=(m.charCodeAt(o)||0)+((m.charCodeAt(o+1)||0)<<8)+((m.charCodeAt(o+2)||0)<<16)+((m.charCodeAt(o+3)||0)<<24);return t}var y=D;function E(m,t){let o=m.length,r=[1732584193,-271733879,-1732584194,271733878],n;for(n=64;n<=o;n+=64)l(r,y(m.substring(n-64,n)),t);m=m.substring(n-64);var e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=m.length;for(n=0;n<u;n++)e[n>>2]|=(m.charCodeAt(n)&255)<<(n%4<<3);if(e[n>>2]|=128<<(n%4<<3),n>55)for(l(r,e,t),n=16;n--;)e[n]=0;return e[14]=o*8,l(r,e,t),r}var F=E;function G(m,t){let o=m.length,r=[1732584193,-271733879,-1732584194,271733878],n;for(n=64;n<=o;n+=64){let i=H(m,n-64);l(r,i,t);}let e=o-n+64,u=new Array(16).fill(0);for(let i=0;i<e;i++)u[i>>2]|=(m[o-e+i]&255)<<(i%4<<3);if(u[e>>2]|=128<<(e%4<<3),e>55){l(r,u,t);for(let i=0;i<16;i++)u[i]=0;}return u[14]=o*8,u[15]=0,l(r,u,t),r}function H(m,t){let o=[];for(let r=0;r<64;r+=4)o[r>>2]=(m[t+r]||0)+((m[t+r+1]||0)<<8)+((m[t+r+2]||0)<<16)+((m[t+r+3]||0)<<24);return o}var C=G;function k(m){return h(F(m,f))}function nn(m){return h(C(m,f))}exports.md5=k;exports.md5Buffer=nn;exports.md5Core=k;//# sourceMappingURL=index.cjs.map
2
- //# sourceMappingURL=index.cjs.map
1
+ 'use strict';var B="0123456789abcdef".split(""),s=B;function j(m){let t="";for(let o=0;o<4;o++)t+=s[m>>o*8+4&15]+s[m>>o*8&15];return t}function v(m){let t=m.length,o=new Array(t);for(let r=0;r<t;r++)o[r]=j(m[r]);return o.join("")}var h=v;function w(m,t){return m+t&4294967295}var f=w;function _(m,t,o,r,n){let e=n||f;return t=e(e(t,m),e(o,r)),t}function q(m,t,o,r){var e=(r||f)(m<<t|m>>>32-t,o);return e}function p(m,t,o,r,n,e,u){return t=_(m,t,r,e,u),q(t,n,o,u)}function g(m,t,o,r,n,e,u,i){return p(o&r|~o&n,t,o,e,u,i,m)}function a(m,t,o,r,n,e,u,i){return p(o&n|r&~n,t,o,e,u,i,m)}function A(m,t,o,r,n,e,u,i){return p(o^r^n,t,o,e,u,i,m)}function x(m,t,o,r,n,e,u,i){return p(r^(o|~n),t,o,e,u,i,m)}function z(m,t,o){typeof o>"u"&&(o=f);let r=m[0],n=m[1],e=m[2],u=m[3],i=g.bind(null,o);r=i(r,n,e,u,t[0],7,-680876936),u=i(u,r,n,e,t[1],12,-389564586),e=i(e,u,r,n,t[2],17,606105819),n=i(n,e,u,r,t[3],22,-1044525330),r=i(r,n,e,u,t[4],7,-176418897),u=i(u,r,n,e,t[5],12,1200080426),e=i(e,u,r,n,t[6],17,-1473231341),n=i(n,e,u,r,t[7],22,-45705983),r=i(r,n,e,u,t[8],7,1770035416),u=i(u,r,n,e,t[9],12,-1958414417),e=i(e,u,r,n,t[10],17,-42063),n=i(n,e,u,r,t[11],22,-1990404162),r=i(r,n,e,u,t[12],7,1804603682),u=i(u,r,n,e,t[13],12,-40341101),e=i(e,u,r,n,t[14],17,-1502002290),n=i(n,e,u,r,t[15],22,1236535329);let b=a.bind(null,o);r=b(r,n,e,u,t[1],5,-165796510),u=b(u,r,n,e,t[6],9,-1069501632),e=b(e,u,r,n,t[11],14,643717713),n=b(n,e,u,r,t[0],20,-373897302),r=b(r,n,e,u,t[5],5,-701558691),u=b(u,r,n,e,t[10],9,38016083),e=b(e,u,r,n,t[15],14,-660478335),n=b(n,e,u,r,t[4],20,-405537848),r=b(r,n,e,u,t[9],5,568446438),u=b(u,r,n,e,t[14],9,-1019803690),e=b(e,u,r,n,t[3],14,-187363961),n=b(n,e,u,r,t[8],20,1163531501),r=b(r,n,e,u,t[13],5,-1444681467),u=b(u,r,n,e,t[2],9,-51403784),e=b(e,u,r,n,t[7],14,1735328473),n=b(n,e,u,r,t[12],20,-1926607734);let c=A.bind(null,o);r=c(r,n,e,u,t[5],4,-378558),u=c(u,r,n,e,t[8],11,-2022574463),e=c(e,u,r,n,t[11],16,1839030562),n=c(n,e,u,r,t[14],23,-35309556),r=c(r,n,e,u,t[1],4,-1530992060),u=c(u,r,n,e,t[4],11,1272893353),e=c(e,u,r,n,t[7],16,-155497632),n=c(n,e,u,r,t[10],23,-1094730640),r=c(r,n,e,u,t[13],4,681279174),u=c(u,r,n,e,t[0],11,-358537222),e=c(e,u,r,n,t[3],16,-722521979),n=c(n,e,u,r,t[6],23,76029189),r=c(r,n,e,u,t[9],4,-640364487),u=c(u,r,n,e,t[12],11,-421815835),e=c(e,u,r,n,t[15],16,530742520),n=c(n,e,u,r,t[2],23,-995338651);let d=x.bind(null,o);r=d(r,n,e,u,t[0],6,-198630844),u=d(u,r,n,e,t[7],10,1126891415),e=d(e,u,r,n,t[14],15,-1416354905),n=d(n,e,u,r,t[5],21,-57434055),r=d(r,n,e,u,t[12],6,1700485571),u=d(u,r,n,e,t[3],10,-1894986606),e=d(e,u,r,n,t[10],15,-1051523),n=d(n,e,u,r,t[1],21,-2054922799),r=d(r,n,e,u,t[8],6,1873313359),u=d(u,r,n,e,t[15],10,-30611744),e=d(e,u,r,n,t[6],15,-1560198380),n=d(n,e,u,r,t[13],21,1309151649),r=d(r,n,e,u,t[4],6,-145523070),u=d(u,r,n,e,t[11],10,-1120210379),e=d(e,u,r,n,t[2],15,718787259),n=d(n,e,u,r,t[9],21,-343485551),m[0]=o(r,m[0]),m[1]=o(n,m[1]),m[2]=o(e,m[2]),m[3]=o(u,m[3]);}var l=z;function D(m){let t=[];for(let o=0;o<64;o+=4)t[o>>2]=(m.charCodeAt(o)||0)+((m.charCodeAt(o+1)||0)<<8)+((m.charCodeAt(o+2)||0)<<16)+((m.charCodeAt(o+3)||0)<<24);return t}var y=D;function E(m,t){let o=m.length,r=[1732584193,-271733879,-1732584194,271733878],n;for(n=64;n<=o;n+=64)l(r,y(m.substring(n-64,n)),t);m=m.substring(n-64);var e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=m.length;for(n=0;n<u;n++)e[n>>2]|=(m.charCodeAt(n)&255)<<(n%4<<3);if(e[n>>2]|=128<<(n%4<<3),n>55)for(l(r,e,t),n=16;n--;)e[n]=0;return e[14]=o*8,l(r,e,t),r}var F=E;function G(m,t){let o=m.length,r=[1732584193,-271733879,-1732584194,271733878],n;for(n=64;n<=o;n+=64){let i=H(m,n-64);l(r,i,t);}let e=o-n+64,u=new Array(16).fill(0);for(let i=0;i<e;i++)u[i>>2]|=(m[o-e+i]&255)<<(i%4<<3);if(u[e>>2]|=128<<(e%4<<3),e>55){l(r,u,t);for(let i=0;i<16;i++)u[i]=0;}return u[14]=o*8,u[15]=0,l(r,u,t),r}function H(m,t){let o=[];for(let r=0;r<64;r+=4)o[r>>2]=(m[t+r]||0)+((m[t+r+1]||0)<<8)+((m[t+r+2]||0)<<16)+((m[t+r+3]||0)<<24);return o}var C=G;function k(m){return h(F(m,f))}function nn(m){return h(C(m,f))}exports.md5=k;exports.md5Buffer=nn;exports.md5Core=k;
@@ -1,2 +1 @@
1
- export{a as md5,b as md5Buffer,a as md5Core}from'../chunk-NWQ4N5RX.js';import'../chunk-R4JB5MBR.js';import'../chunk-2YXXFGBV.js';//# sourceMappingURL=index.js.map
2
- //# sourceMappingURL=index.js.map
1
+ export{a as md5,b as md5Buffer,a as md5Core}from'../chunk-Z4JB6DTM.js';import'../chunk-DFR4GYL3.js';import'../chunk-I7AUKTXE.js';
package/dist/index.cjs CHANGED
@@ -1,4 +1,3 @@
1
1
  'use strict';var stream=require('stream'),D=require('fs');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var D__default=/*#__PURE__*/_interopDefault(D);var N=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+i+'" is not supported')});var Z="0123456789abcdef".split(""),O=Z;function ee(i){let e="";for(let n=0;n<4;n++)e+=O[i>>n*8+4&15]+O[i>>n*8&15];return e}function re(i){let e=i.length,n=new Array(e);for(let r=0;r<e;r++)n[r]=ee(i[r]);return n.join("")}var S=re;function te(i,e){return i+e&4294967295}var b=te;function ne(i,e,n,r,t){let s=t||b;return e=s(s(e,i),s(n,r)),e}function se(i,e,n,r){var s=(r||b)(i<<e|i>>>32-e,n);return s}function C(i,e,n,r,t,s,a){return e=ne(i,e,r,s,a),se(e,t,n,a)}function I(i,e,n,r,t,s,a,o){return C(n&r|~n&t,e,n,s,a,o,i)}function L(i,e,n,r,t,s,a,o){return C(n&t|r&~t,e,n,s,a,o,i)}function $(i,e,n,r,t,s,a,o){return C(n^r^t,e,n,s,a,o,i)}function _(i,e,n,r,t,s,a,o){return C(r^(n|~t),e,n,s,a,o,i)}function ie(i,e,n){typeof n>"u"&&(n=b);let r=i[0],t=i[1],s=i[2],a=i[3],o=I.bind(null,n);r=o(r,t,s,a,e[0],7,-680876936),a=o(a,r,t,s,e[1],12,-389564586),s=o(s,a,r,t,e[2],17,606105819),t=o(t,s,a,r,e[3],22,-1044525330),r=o(r,t,s,a,e[4],7,-176418897),a=o(a,r,t,s,e[5],12,1200080426),s=o(s,a,r,t,e[6],17,-1473231341),t=o(t,s,a,r,e[7],22,-45705983),r=o(r,t,s,a,e[8],7,1770035416),a=o(a,r,t,s,e[9],12,-1958414417),s=o(s,a,r,t,e[10],17,-42063),t=o(t,s,a,r,e[11],22,-1990404162),r=o(r,t,s,a,e[12],7,1804603682),a=o(a,r,t,s,e[13],12,-40341101),s=o(s,a,r,t,e[14],17,-1502002290),t=o(t,s,a,r,e[15],22,1236535329);let c=L.bind(null,n);r=c(r,t,s,a,e[1],5,-165796510),a=c(a,r,t,s,e[6],9,-1069501632),s=c(s,a,r,t,e[11],14,643717713),t=c(t,s,a,r,e[0],20,-373897302),r=c(r,t,s,a,e[5],5,-701558691),a=c(a,r,t,s,e[10],9,38016083),s=c(s,a,r,t,e[15],14,-660478335),t=c(t,s,a,r,e[4],20,-405537848),r=c(r,t,s,a,e[9],5,568446438),a=c(a,r,t,s,e[14],9,-1019803690),s=c(s,a,r,t,e[3],14,-187363961),t=c(t,s,a,r,e[8],20,1163531501),r=c(r,t,s,a,e[13],5,-1444681467),a=c(a,r,t,s,e[2],9,-51403784),s=c(s,a,r,t,e[7],14,1735328473),t=c(t,s,a,r,e[12],20,-1926607734);let u=$.bind(null,n);r=u(r,t,s,a,e[5],4,-378558),a=u(a,r,t,s,e[8],11,-2022574463),s=u(s,a,r,t,e[11],16,1839030562),t=u(t,s,a,r,e[14],23,-35309556),r=u(r,t,s,a,e[1],4,-1530992060),a=u(a,r,t,s,e[4],11,1272893353),s=u(s,a,r,t,e[7],16,-155497632),t=u(t,s,a,r,e[10],23,-1094730640),r=u(r,t,s,a,e[13],4,681279174),a=u(a,r,t,s,e[0],11,-358537222),s=u(s,a,r,t,e[3],16,-722521979),t=u(t,s,a,r,e[6],23,76029189),r=u(r,t,s,a,e[9],4,-640364487),a=u(a,r,t,s,e[12],11,-421815835),s=u(s,a,r,t,e[15],16,530742520),t=u(t,s,a,r,e[2],23,-995338651);let f=_.bind(null,n);r=f(r,t,s,a,e[0],6,-198630844),a=f(a,r,t,s,e[7],10,1126891415),s=f(s,a,r,t,e[14],15,-1416354905),t=f(t,s,a,r,e[5],21,-57434055),r=f(r,t,s,a,e[12],6,1700485571),a=f(a,r,t,s,e[3],10,-1894986606),s=f(s,a,r,t,e[10],15,-1051523),t=f(t,s,a,r,e[1],21,-2054922799),r=f(r,t,s,a,e[8],6,1873313359),a=f(a,r,t,s,e[15],10,-30611744),s=f(s,a,r,t,e[6],15,-1560198380),t=f(t,s,a,r,e[13],21,1309151649),r=f(r,t,s,a,e[4],6,-145523070),a=f(a,r,t,s,e[11],10,-1120210379),s=f(s,a,r,t,e[2],15,718787259),t=f(t,s,a,r,e[9],21,-343485551),i[0]=n(r,i[0]),i[1]=n(t,i[1]),i[2]=n(s,i[2]),i[3]=n(a,i[3]);}var m=ie;function ae(i){let e=[];for(let n=0;n<64;n+=4)e[n>>2]=(i.charCodeAt(n)||0)+((i.charCodeAt(n+1)||0)<<8)+((i.charCodeAt(n+2)||0)<<16)+((i.charCodeAt(n+3)||0)<<24);return e}var G=ae;function oe(i,e){let n=i.length,r=[1732584193,-271733879,-1732584194,271733878],t;for(t=64;t<=n;t+=64)m(r,G(i.substring(t-64,t)),e);i=i.substring(t-64);var s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a=i.length;for(t=0;t<a;t++)s[t>>2]|=(i.charCodeAt(t)&255)<<(t%4<<3);if(s[t>>2]|=128<<(t%4<<3),t>55)for(m(r,s,e),t=16;t--;)s[t]=0;return s[14]=n*8,m(r,s,e),r}var z=oe;function ce(i,e){let n=i.length,r=[1732584193,-271733879,-1732584194,271733878],t;for(t=64;t<=n;t+=64){let o=ue(i,t-64);m(r,o,e);}let s=n-t+64,a=new Array(16).fill(0);for(let o=0;o<s;o++)a[o>>2]|=(i[n-s+o]&255)<<(o%4<<3);if(a[s>>2]|=128<<(s%4<<3),s>55){m(r,a,e);for(let o=0;o<16;o++)a[o]=0;}return a[14]=n*8,a[15]=0,m(r,a,e),r}function ue(i,e){let n=[];for(let r=0;r<64;r+=4)n[r>>2]=(i[e+r]||0)+((i[e+r+1]||0)<<8)+((i[e+r+2]||0)<<16)+((i[e+r+3]||0)<<24);return n}var K=ce;function l(i){return S(z(i,b))}function q(i){return S(K(i,b))}var g=class{constructor(){this.name="webcrypto";this.version="1.0.0";}static isAvailable(){return typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof crypto.subtle.digest=="function"}async hash(e){return l(e)}async hashBinary(e){let n=e instanceof ArrayBuffer?new TextDecoder().decode(e):new TextDecoder().decode(e);return l(n)}update(e){throw new Error("Web Crypto API does not support streaming updates")}digest(e){throw new Error("Web Crypto API does not support streaming")}reset(){}};var w=class{constructor(){this.name="nodecrypto";this.version="1.0.0";}static isAvailable(){try{return typeof N("crypto").createHash=="function"}catch{return false}}hash(e){return N("crypto").createHash("md5").update(e).digest("hex")}async hashBinary(e){let n=N("crypto"),r=e instanceof Uint8Array?e:new Uint8Array(e);return n.createHash("md5").update(r).digest("hex")}update(e){}digest(e){throw new Error("Node crypto streaming not implemented")}reset(){}};var B=class{constructor(){this.name="ie11";this.version="1.0.0";}static isAvailable(){if(typeof window>"u")return false;let e=window;return typeof e.msCrypto<"u"&&typeof e.msCrypto.subtle<"u"&&typeof e.msCrypto.subtle.digest=="function"}async hash(e){let r=new TextEncoder().encode(e);return await this.hashBinary(r)}async hashBinary(e){let n=window,r=e instanceof Uint8Array?e.buffer:e,t=await n.msCrypto.subtle.digest("MD5",r);return this.bufferToHex(t)}bufferToHex(e){return Array.from(new Uint8Array(e)).map(n=>n.toString(16).padStart(2,"0")).join("")}update(e){throw new Error("msCrypto does not support streaming updates")}digest(e){throw new Error("msCrypto does not support streaming")}reset(){}};var p=class i extends stream.Transform{constructor(n){super({readableObjectMode:false,writableObjectMode:false});this.initialMD5State=[1732584193,-271733879,-1732584194,271733878];this.bufferCapacity=64;this.buffer=new Uint8Array(this.bufferCapacity);this.add32=n?.add32||b,this.state={state:[...this.initialMD5State],bytesProcessed:0,bufferLength:0,buffer:this.buffer};}_transform(n,r,t){try{let s=n,a=s.length;if(a===0){t();return}if(this.state.bufferLength>0){let u=this.state.bufferLength,f=64-u,h=Math.min(a,f);for(let d=0;d<h;d++)this.buffer[u+d]=s[d];if(this.state.bufferLength+=h,this.state.bufferLength===64&&this._processBufferBlock(),h===a){t();return}let y=a-h;for(let d=0;d<y;d++)s[d]=s[h+d];let v=Buffer.alloc(y);for(let d=0;d<y;d++)v[d]=s[d];s=v;}let o=Math.floor(s.length/64);for(let u=0;u<o;u++){let f=u*64,h=[];for(let y=0;y<16;y++){let v=f+y*4;h[y]=s[v]+(s[v+1]<<8)+(s[v+2]<<16)+(s[v+3]<<24);}m(this.state.state,h,this.add32),this.state.bytesProcessed+=64;}let c=s.length%64;if(c>0){this.buffer.length<c&&(this.buffer=new Uint8Array(c),this.state.buffer=this.buffer);for(let u=0;u<c;u++)this.buffer[u]=s[o*64+u];this.state.bufferLength=c;}t();}catch(s){t(s);}}_processBufferBlock(){let n=this.state.buffer,r=[];for(let t=0;t<16;t++){let s=t*4;r[t]=n[s]+(n[s+1]<<8)+(n[s+2]<<16)+(n[s+3]<<24);}m(this.state.state,r,this.add32),this.state.bytesProcessed+=64,this.state.bufferLength=0;}_flush(n){try{let{state:r,bufferLength:t,buffer:s}=this.state,a=new Array(16).fill(0);for(let c=0;c<t;c++)a[c>>2]|=(s[c]&255)<<(c%4<<3);if(a[t>>2]|=128<<(t%4<<3),t>55){m(r,a,this.add32);for(let c=0;c<16;c++)a[c]=0;}a[14]=(this.state.bytesProcessed+t)*8,a[15]=0,m(r,a,this.add32);let o=S(r);this.emit("md5",{digest:o,bytesProcessed:this.state.bytesProcessed+t}),n();}catch(r){n(r);}}getCurrentState(){return {state:[...this.state.state],bytesProcessed:this.state.bytesProcessed+this.state.bufferLength}}getBytesProcessed(){return this.state.bytesProcessed+this.state.bufferLength}reset(){this.state={state:[...this.initialMD5State],bytesProcessed:0,bufferLength:0,buffer:this.buffer},this.buffer=new Uint8Array(this.bufferCapacity),this.state.buffer=this.buffer,this.state.bufferLength=0;}static fromStream(n,r){let t=new i(r),s=E.call(t,n);return {stream:t,result:s}}};function R(i){return new p(i)}async function E(i){return new Promise((e,n)=>{let r=[];i.pipe(this).on("md5",t=>{r.push(t);}).on("error",n).on("finish",()=>{e(r[0]);});})}function j(i,e){let n=new p(e),r=E.call(n,i);return {stream:n,result:r}}var A=class{constructor(){this.name="stream";this.version="0.1.0";this.state=null;}initNodeStream(e){this.state={stream:e,type:"node"};}initWhatWGStream(e){this.state={stream:e,type:"whatwg"};}async hash(e){let n=new p;return (await new Promise((t,s)=>{n.on("md5",a=>t(a)).on("error",s).end(e);})).digest}async hashBinary(e){let n=new p,r;return e instanceof Uint8Array?r=Buffer.from(e):e instanceof ArrayBuffer?r=Buffer.from(new Uint8Array(e)):r=Buffer.from(e),(await new Promise((s,a)=>{n.on("md5",o=>s(o)).on("error",a).end(r);})).digest}update(e){if(!this.state)throw new Error("Stream backend not initialized. Call initNodeStream() or initWhatWGStream() first.");if(this.state.type==="node"){let n=this.state.stream,r;typeof e=="string"||e instanceof Uint8Array?r=Buffer.from(e):e instanceof ArrayBuffer?r=Buffer.from(new Uint8Array(e)):r=Buffer.from(e),n.write(r);}}digest(e){if(!this.state)throw new Error("Stream backend not initialized. Call initNodeStream() or initWhatWGStream() first.");if(this.state.type==="node"){let n=this.state.stream;return n.end(),new Promise((r,t)=>{n.on("md5",s=>{if(e==="buffer"){let a=s.digest,o=[];for(let c=0;c<a.length;c+=2)o.push(parseInt(a.substring(c,c+2),16));r(Buffer.from(o));}else r(s.digest);}).on("error",t);})}else return this.state.stream.getResult().then(r=>r.digest)}reset(){this.state&&this.state.type==="node"&&this.state.stream.reset();}static isAvailable(){return true}};var k=class{constructor(){this.name="purejs";this.version="0.1.0";this.state={data:"",finished:false};}hash(e){return l(e)}async hashBinary(e){let n=e instanceof ArrayBuffer?new TextDecoder().decode(e):new TextDecoder().decode(e);return l(n)}update(e){this.state.finished&&(this.state={data:"",finished:false}),e instanceof ArrayBuffer?this.state.data+=new TextDecoder().decode(e):e instanceof Uint8Array?this.state.data+=new TextDecoder().decode(e):this.state.data+=e;}digest(e){let n=l(this.state.data);return this.state.finished=true,e==="buffer"?this.hexToBuffer(n):n}reset(){this.state={data:"",finished:false};}static isAvailable(){return true}hexToBuffer(e){let n=[];for(let r=0;r<e.length;r+=2)n.push(parseInt(e.substring(r,r+2),16));return new Uint8Array(n)}};async function de(i){switch(i){case "webcrypto":let e=g.isAvailable();return {backend:"webcrypto",available:e,reason:e?void 0:"Web Crypto API not available"};case "nodecrypto":let n=w.isAvailable();return {backend:"nodecrypto",available:n,reason:n?void 0:"Node.js crypto not available"};case "ie11":let r=B.isAvailable();return {backend:"ie11",available:r,reason:r?void 0:"IE11 msCrypto not available"};case "purejs":return {backend:"purejs",available:true,reason:"Always available"};case "stream":let t=typeof process<"u"&&process.versions&&"node"in process.versions,s=typeof window<"u";return {backend:"stream",available:t||s,reason:t||s?void 0:"Streams not available"};default:return {backend:i||"unknown",available:false,reason:"Unknown backend"}}}async function x(){let i=["webcrypto","nodecrypto","ie11","purejs","stream"],e=[];for(let n of i){let{available:r}=await de(n);r&&e.push(n);}return e}var me=[{name:"nodecrypto",priority:1,description:"Node.js native crypto (fastest)"},{name:"webcrypto",priority:2,description:"Web Crypto API (fast, hardware accelerated)"},{name:"ie11",priority:3,description:"IE11 msCrypto (legacy)"},{name:"stream",priority:4,description:"Streaming backend (for large files and memory efficiency)"},{name:"purejs",priority:5,description:"Pure JavaScript (always available, slower)"}];function F(i){let e=[...me].sort((n,r)=>n.priority-r.priority);for(let{name:n}of e)if(i.includes(n))return n;return "purejs"}var M=class i{constructor(){}static getInstance(){return i.instance||(i.instance=new i),i.instance}async createBackendByName(e){switch(e){case "nodecrypto":return new w;case "webcrypto":return new g;case "ie11":return new B;case "stream":return new A;default:return new k}}async createBackend(e){let n=e||F(await x());return this.createBackendByName(n)}},le=M.getInstance(),P=class{constructor(e=["nodecrypto","webcrypto","stream","ie11","purejs"]){this.detector=M.getInstance(),this.fallbackOrder=e;}async execute(e){let n=[];for(let r of this.fallbackOrder)try{let t=await this.detector.createBackendByName(r),s=await e(t);return {success:!0,backend:r,data:s}}catch(t){if(n.push({backend:r,error:t}),r===this.fallbackOrder[this.fallbackOrder.length-1])return {success:false,backend:r,data:null,errors:n}}return {success:false,backend:"",data:null,errors:n}}async hash(e){return this.execute(async n=>n.hash(e))}async hashBinary(e){return this.execute(async n=>n.hashBinary(e))}async getBestBackend(){let e=await this.getAvailableBackends();return e.length===0?"purejs":e[0]}async getAvailableBackends(){let e=[];for(let n of this.fallbackOrder)try{await this.detector.createBackendByName(n),e.push(n);}catch{}return e}getMetrics(){return {}}},be=new P;async function pe(i,e={}){let n=new P;if(e.forceBackend)return (await n.detector.createBackendByName(e.forceBackend)).hash(i);if(e.fallback===false)return (await n.detector.createBackend()).hash(i);let r=await n.hash(i);if(r.success)return e.reportFallback&&r.backend!=="nodecrypto"&&r.backend!=="webcrypto"&&console.info(`MD5 used fallback backend: ${r.backend}`),r.data;let t=r.errors?r.errors.map(s=>`${s.backend}: ${s.error.message}`).join(", "):"All backends failed";throw new Error(`MD5 hash failed after all attempts: ${t}`)}var U=class{constructor(){this.metrics={nodecrypto:{success:0,fail:0},webcrypto:{success:0,fail:0},ie11:{success:0,fail:0},stream:{success:0,fail:0},purejs:{success:0,fail:0}};}recordSuccess(e){this.metrics[e]&&this.metrics[e].success++;}recordFail(e){this.metrics[e]&&this.metrics[e].fail++;}getMetrics(){return this.metrics}getSummary(){return `Total operations: ${Object.values(this.metrics).reduce((n,r)=>n+r.success+r.fail,0)}
2
2
  `+Object.entries(this.metrics).map(([,n])=>`${n.success} success, ${n.fail} fail`).join(`
3
- `)}reset(){Object.keys(this.metrics).forEach(e=>{this.metrics[e]={success:0,fail:0};});}},he=new U;async function W(i,e={}){if(typeof i!="string"||i.trim()==="")throw new Error("Invalid file path: must be a non-empty string");if(!D__default.default.existsSync(i))throw new Error(`File not found: ${i}`);let n;try{n=D__default.default.statSync(i);}catch(t){throw new Error(`Failed to access file ${i}: ${t.message}`)}if(!n.isFile())throw new Error(`Path is not a file: ${i}`);let r=D__default.default.createReadStream(i,{highWaterMark:e.chunkSize||64*1024});try{return await T(r,{onProgress:e.onProgress,totalSize:n.size})}finally{r.destroy();}}async function T(i,e={}){if(!i||typeof i.on!="function")throw new Error("Invalid readable stream: stream must have event listener support");let n=R(),r=0;return e.onProgress&&i.on("data",t=>{r+=t.length,e.onProgress?.(r);}),i.on("error",t=>{n.destroy(t);}),i.on("end",()=>{n.end();}),new Promise((t,s)=>{n.on("md5",a=>{t(a);}).on("error",a=>{s(a);}),i.pipe(n);})}async function J(i,e={}){return (await W(i,e)).digest}async function Y(i,e={}){return (await T(i,e)).digest}async function Q(i,e,n={}){return (await W(i,n)).digest.toLowerCase()===e.toLowerCase()}function V(i){if(typeof i!="string"||i.trim()==="")throw new Error("Invalid file path: must be a non-empty string");if(!D__default.default.existsSync(i))throw new Error(`File not found: ${i}`);let e;try{e=D__default.default.statSync(i);}catch(r){throw new Error(`Failed to access file ${i}: ${r.message}`)}if(!e.isFile())throw new Error(`Path is not a file: ${i}`);let n;try{n=D__default.default.readFileSync(i);}catch(r){throw new Error(`Failed to read file ${i}: ${r.message}`)}return q(n)}function X(i,e){let n=0;return r=>{if(i>0){let t=Math.min(100,r/i*100);Math.floor(t)!==Math.floor(n)&&(e(t),n=t);}}}Object.defineProperty(p,"fromStream",{value:j,writable:false,configurable:false});var H=class{constructor(){this.backend=null;this.backendName=null;}async hash(e){return (await this.getBackend()).hash(e)}async hashBinary(e){return (await this.getBackend()).hashBinary(e)}async getBackendName(){if(!this.backendName){let e=await x();this.backendName=F(e);}return this.backendName}static async getAvailableBackends(){return await x()}async useBackend(e){this.backend=await this.createBackendByName(e),this.backendName=e;}async createBackendByName(e){switch(e){case "nodecrypto":return new w;case "webcrypto":return new g;case "ie11":return new B;case "stream":return new A;default:return {hash:n=>l(n),hashBinary:async n=>l(n instanceof Uint8Array?new TextDecoder().decode(n):new TextDecoder().decode(new Uint8Array(n))),update:()=>{},digest:()=>"",reset:()=>{},name:"purejs",version:"0.1.0"}}}async getBackend(){if(this.backend)return this.backend;let e=await x(),n=F(e);return this.backend=await this.createBackendByName(n),this.backendName=n,this.backend}};function Ar(i){return l(i)}var ye=new H;async function xr(i){return ye.hash(i)}exports.BackendDetector=M;exports.FallbackManager=P;exports.IE11Backend=B;exports.MD5Stream=p;exports.MetricsCollector=U;exports.NodeCryptoBackend=w;exports.PureJSBackend=k;exports.WebCryptoBackend=g;exports.createMD5Stream=R;exports.createProgressTracker=X;exports.detector=le;exports.fallbackManager=be;exports.fromStream=j;exports.getAllAvailableBackends=x;exports.getBestAvailableBackend=F;exports.hashFile=W;exports.hashFileDigest=J;exports.hashFileStream=T;exports.hashFileStreamDigest=Y;exports.hashFileSync=V;exports.md5=Ar;exports.md5Adapter=ye;exports.md5Async=xr;exports.md5Core=l;exports.md5Original=l;exports.metrics=he;exports.pipeThroughMD5=E;exports.robustHash=pe;exports.verifyFile=Q;//# sourceMappingURL=index.cjs.map
4
- //# sourceMappingURL=index.cjs.map
3
+ `)}reset(){Object.keys(this.metrics).forEach(e=>{this.metrics[e]={success:0,fail:0};});}},he=new U;async function W(i,e={}){if(typeof i!="string"||i.trim()==="")throw new Error("Invalid file path: must be a non-empty string");if(!D__default.default.existsSync(i))throw new Error(`File not found: ${i}`);let n;try{n=D__default.default.statSync(i);}catch(t){throw new Error(`Failed to access file ${i}: ${t.message}`)}if(!n.isFile())throw new Error(`Path is not a file: ${i}`);let r=D__default.default.createReadStream(i,{highWaterMark:e.chunkSize||64*1024});try{return await T(r,{onProgress:e.onProgress,totalSize:n.size})}finally{r.destroy();}}async function T(i,e={}){if(!i||typeof i.on!="function")throw new Error("Invalid readable stream: stream must have event listener support");let n=R(),r=0;return e.onProgress&&i.on("data",t=>{r+=t.length,e.onProgress?.(r);}),i.on("error",t=>{n.destroy(t);}),i.on("end",()=>{n.end();}),new Promise((t,s)=>{n.on("md5",a=>{t(a);}).on("error",a=>{s(a);}),i.pipe(n);})}async function J(i,e={}){return (await W(i,e)).digest}async function Y(i,e={}){return (await T(i,e)).digest}async function Q(i,e,n={}){return (await W(i,n)).digest.toLowerCase()===e.toLowerCase()}function V(i){if(typeof i!="string"||i.trim()==="")throw new Error("Invalid file path: must be a non-empty string");if(!D__default.default.existsSync(i))throw new Error(`File not found: ${i}`);let e;try{e=D__default.default.statSync(i);}catch(r){throw new Error(`Failed to access file ${i}: ${r.message}`)}if(!e.isFile())throw new Error(`Path is not a file: ${i}`);let n;try{n=D__default.default.readFileSync(i);}catch(r){throw new Error(`Failed to read file ${i}: ${r.message}`)}return q(n)}function X(i,e){let n=0;return r=>{if(i>0){let t=Math.min(100,r/i*100);Math.floor(t)!==Math.floor(n)&&(e(t),n=t);}}}Object.defineProperty(p,"fromStream",{value:j,writable:false,configurable:false});var H=class{constructor(){this.backend=null;this.backendName=null;}async hash(e){return (await this.getBackend()).hash(e)}async hashBinary(e){return (await this.getBackend()).hashBinary(e)}async getBackendName(){if(!this.backendName){let e=await x();this.backendName=F(e);}return this.backendName}static async getAvailableBackends(){return await x()}async useBackend(e){this.backend=await this.createBackendByName(e),this.backendName=e;}async createBackendByName(e){switch(e){case "nodecrypto":return new w;case "webcrypto":return new g;case "ie11":return new B;case "stream":return new A;default:return {hash:n=>l(n),hashBinary:async n=>l(n instanceof Uint8Array?new TextDecoder().decode(n):new TextDecoder().decode(new Uint8Array(n))),update:()=>{},digest:()=>"",reset:()=>{},name:"purejs",version:"0.1.0"}}}async getBackend(){if(this.backend)return this.backend;let e=await x(),n=F(e);return this.backend=await this.createBackendByName(n),this.backendName=n,this.backend}};function Ar(i){return l(i)}var ye=new H;async function xr(i){return ye.hash(i)}exports.BackendDetector=M;exports.FallbackManager=P;exports.IE11Backend=B;exports.MD5Stream=p;exports.MetricsCollector=U;exports.NodeCryptoBackend=w;exports.PureJSBackend=k;exports.WebCryptoBackend=g;exports.createMD5Stream=R;exports.createProgressTracker=X;exports.detector=le;exports.fallbackManager=be;exports.fromStream=j;exports.getAllAvailableBackends=x;exports.getBestAvailableBackend=F;exports.hashFile=W;exports.hashFileDigest=J;exports.hashFileStream=T;exports.hashFileStreamDigest=Y;exports.hashFileSync=V;exports.md5=Ar;exports.md5Adapter=ye;exports.md5Async=xr;exports.md5Core=l;exports.md5Original=l;exports.metrics=he;exports.pipeThroughMD5=E;exports.robustHash=pe;exports.verifyFile=Q;
package/dist/index.js CHANGED
@@ -1,2 +1 @@
1
- import {h,j}from'./chunk-6P2QV5SR.js';export{k as BackendDetector,m as FallbackManager,p as MetricsCollector,a as PureJSBackend,l as detector,n as fallbackManager,h as getAllAvailableBackends,j as getBestAvailableBackend,q as metrics,o as robustHash}from'./chunk-6P2QV5SR.js';import {a as a$2}from'./chunk-VFOAY6XI.js';export{a as IE11Backend}from'./chunk-VFOAY6XI.js';import {a as a$4}from'./chunk-PNZTVQA7.js';export{a as NodeCryptoBackend}from'./chunk-PNZTVQA7.js';import {a as a$3}from'./chunk-G5WHEAIQ.js';export{a as WebCryptoBackend}from'./chunk-G5WHEAIQ.js';import {a as a$1}from'./chunk-4KSCMS4Q.js';import'./chunk-PHZ7FTYF.js';import'./chunk-XB5BQIEX.js';export{g as createProgressTracker,a as hashFile,c as hashFileDigest,b as hashFileStream,d as hashFileStreamDigest,f as hashFileSync,e as verifyFile}from'./chunk-H2K353LR.js';import {a}from'./chunk-NWQ4N5RX.js';export{a as md5Core,a as md5Original}from'./chunk-NWQ4N5RX.js';export{a as MD5Stream,b as createMD5Stream,d as fromStream,c as pipeThroughMD5}from'./chunk-JKVD5LHZ.js';import'./chunk-R4JB5MBR.js';import'./chunk-2YXXFGBV.js';var d=class{constructor(){this.backend=null;this.backendName=null;}async hash(e){return (await this.getBackend()).hash(e)}async hashBinary(e){return (await this.getBackend()).hashBinary(e)}async getBackendName(){if(!this.backendName){let e=await h();this.backendName=j(e);}return this.backendName}static async getAvailableBackends(){return await h()}async useBackend(e){this.backend=await this.createBackendByName(e),this.backendName=e;}async createBackendByName(e){switch(e){case "nodecrypto":return new a$4;case "webcrypto":return new a$3;case "ie11":return new a$2;case "stream":return new a$1;default:return {hash:a$1=>a(a$1),hashBinary:async a$1=>a(a$1 instanceof Uint8Array?new TextDecoder().decode(a$1):new TextDecoder().decode(new Uint8Array(a$1))),update:()=>{},digest:()=>"",reset:()=>{},name:"purejs",version:"0.1.0"}}}async getBackend(){if(this.backend)return this.backend;let e=await h(),a=j(e);return this.backend=await this.createBackendByName(a),this.backendName=a,this.backend}};function I(n){return a(n)}var S=new d;async function O(n){return S.hash(n)}export{I as md5,S as md5Adapter,O as md5Async};//# sourceMappingURL=index.js.map
2
- //# sourceMappingURL=index.js.map
1
+ import'./chunk-374HUUY2.js';import'./chunk-BEGGPFEE.js';import {h,j}from'./chunk-4F2Y3CRO.js';export{k as BackendDetector,m as FallbackManager,p as MetricsCollector,a as PureJSBackend,l as detector,n as fallbackManager,h as getAllAvailableBackends,j as getBestAvailableBackend,q as metrics,o as robustHash}from'./chunk-4F2Y3CRO.js';import {a as a$2}from'./chunk-QB6MF5LD.js';export{a as IE11Backend}from'./chunk-QB6MF5LD.js';import {a as a$4}from'./chunk-XPYPJSJE.js';export{a as NodeCryptoBackend}from'./chunk-XPYPJSJE.js';import {a as a$3}from'./chunk-43QQAXLT.js';export{a as WebCryptoBackend}from'./chunk-43QQAXLT.js';import {a as a$1}from'./chunk-Y2ZKN4NS.js';export{g as createProgressTracker,a as hashFile,c as hashFileDigest,b as hashFileStream,d as hashFileStreamDigest,f as hashFileSync,e as verifyFile}from'./chunk-YDAOGTNB.js';import {a}from'./chunk-Z4JB6DTM.js';export{a as md5Core,a as md5Original}from'./chunk-Z4JB6DTM.js';export{a as MD5Stream,b as createMD5Stream,d as fromStream,c as pipeThroughMD5}from'./chunk-MIU3X4SB.js';import'./chunk-DFR4GYL3.js';import'./chunk-I7AUKTXE.js';var d=class{constructor(){this.backend=null;this.backendName=null;}async hash(e){return (await this.getBackend()).hash(e)}async hashBinary(e){return (await this.getBackend()).hashBinary(e)}async getBackendName(){if(!this.backendName){let e=await h();this.backendName=j(e);}return this.backendName}static async getAvailableBackends(){return await h()}async useBackend(e){this.backend=await this.createBackendByName(e),this.backendName=e;}async createBackendByName(e){switch(e){case "nodecrypto":return new a$4;case "webcrypto":return new a$3;case "ie11":return new a$2;case "stream":return new a$1;default:return {hash:a$1=>a(a$1),hashBinary:async a$1=>a(a$1 instanceof Uint8Array?new TextDecoder().decode(a$1):new TextDecoder().decode(new Uint8Array(a$1))),update:()=>{},digest:()=>"",reset:()=>{},name:"purejs",version:"0.1.0"}}}async getBackend(){if(this.backend)return this.backend;let e=await h(),a=j(e);return this.backend=await this.createBackendByName(a),this.backendName=a,this.backend}};function I(n){return a(n)}var S=new d;async function O(n){return S.hash(n)}export{I as md5,S as md5Adapter,O as md5Async};
@@ -1,2 +1 @@
1
- 'use strict';var stream=require('stream');function x(o,n){return o+n&4294967295}var l=x;function v(o,n,i,e,r){let t=r||l;return n=t(t(n,o),t(i,e)),n}function L(o,n,i,e){var t=(e||l)(o<<n|o>>>32-n,i);return t}function y(o,n,i,e,r,t,s){return n=v(o,n,e,t,s),L(n,r,i,s)}function M(o,n,i,e,r,t,s,a){return y(i&e|~i&r,n,i,t,s,a,o)}function D(o,n,i,e,r,t,s,a){return y(i&r|e&~r,n,i,t,s,a,o)}function A(o,n,i,e,r,t,s,a){return y(i^e^r,n,i,t,s,a,o)}function w(o,n,i,e,r,t,s,a){return y(e^(i|~r),n,i,t,s,a,o)}function R(o,n,i){typeof i>"u"&&(i=l);let e=o[0],r=o[1],t=o[2],s=o[3],a=M.bind(null,i);e=a(e,r,t,s,n[0],7,-680876936),s=a(s,e,r,t,n[1],12,-389564586),t=a(t,s,e,r,n[2],17,606105819),r=a(r,t,s,e,n[3],22,-1044525330),e=a(e,r,t,s,n[4],7,-176418897),s=a(s,e,r,t,n[5],12,1200080426),t=a(t,s,e,r,n[6],17,-1473231341),r=a(r,t,s,e,n[7],22,-45705983),e=a(e,r,t,s,n[8],7,1770035416),s=a(s,e,r,t,n[9],12,-1958414417),t=a(t,s,e,r,n[10],17,-42063),r=a(r,t,s,e,n[11],22,-1990404162),e=a(e,r,t,s,n[12],7,1804603682),s=a(s,e,r,t,n[13],12,-40341101),t=a(t,s,e,r,n[14],17,-1502002290),r=a(r,t,s,e,n[15],22,1236535329);let u=D.bind(null,i);e=u(e,r,t,s,n[1],5,-165796510),s=u(s,e,r,t,n[6],9,-1069501632),t=u(t,s,e,r,n[11],14,643717713),r=u(r,t,s,e,n[0],20,-373897302),e=u(e,r,t,s,n[5],5,-701558691),s=u(s,e,r,t,n[10],9,38016083),t=u(t,s,e,r,n[15],14,-660478335),r=u(r,t,s,e,n[4],20,-405537848),e=u(e,r,t,s,n[9],5,568446438),s=u(s,e,r,t,n[14],9,-1019803690),t=u(t,s,e,r,n[3],14,-187363961),r=u(r,t,s,e,n[8],20,1163531501),e=u(e,r,t,s,n[13],5,-1444681467),s=u(s,e,r,t,n[2],9,-51403784),t=u(t,s,e,r,n[7],14,1735328473),r=u(r,t,s,e,n[12],20,-1926607734);let f=A.bind(null,i);e=f(e,r,t,s,n[5],4,-378558),s=f(s,e,r,t,n[8],11,-2022574463),t=f(t,s,e,r,n[11],16,1839030562),r=f(r,t,s,e,n[14],23,-35309556),e=f(e,r,t,s,n[1],4,-1530992060),s=f(s,e,r,t,n[4],11,1272893353),t=f(t,s,e,r,n[7],16,-155497632),r=f(r,t,s,e,n[10],23,-1094730640),e=f(e,r,t,s,n[13],4,681279174),s=f(s,e,r,t,n[0],11,-358537222),t=f(t,s,e,r,n[3],16,-722521979),r=f(r,t,s,e,n[6],23,76029189),e=f(e,r,t,s,n[9],4,-640364487),s=f(s,e,r,t,n[12],11,-421815835),t=f(t,s,e,r,n[15],16,530742520),r=f(r,t,s,e,n[2],23,-995338651);let m=w.bind(null,i);e=m(e,r,t,s,n[0],6,-198630844),s=m(s,e,r,t,n[7],10,1126891415),t=m(t,s,e,r,n[14],15,-1416354905),r=m(r,t,s,e,n[5],21,-57434055),e=m(e,r,t,s,n[12],6,1700485571),s=m(s,e,r,t,n[3],10,-1894986606),t=m(t,s,e,r,n[10],15,-1051523),r=m(r,t,s,e,n[1],21,-2054922799),e=m(e,r,t,s,n[8],6,1873313359),s=m(s,e,r,t,n[15],10,-30611744),t=m(t,s,e,r,n[6],15,-1560198380),r=m(r,t,s,e,n[13],21,1309151649),e=m(e,r,t,s,n[4],6,-145523070),s=m(s,e,r,t,n[11],10,-1120210379),t=m(t,s,e,r,n[2],15,718787259),r=m(r,t,s,e,n[9],21,-343485551),o[0]=i(e,o[0]),o[1]=i(r,o[1]),o[2]=i(t,o[2]),o[3]=i(s,o[3]);}var p=R;var W="0123456789abcdef".split(""),S=W;function U(o){let n="";for(let i=0;i<4;i++)n+=S[o>>i*8+4&15]+S[o>>i*8&15];return n}function C(o){let n=o.length,i=new Array(n);for(let e=0;e<n;e++)i[e]=U(o[e]);return i.join("")}var B=C;var g=class o extends stream.Transform{constructor(i){super({readableObjectMode:false,writableObjectMode:false});this.initialMD5State=[1732584193,-271733879,-1732584194,271733878];this.bufferCapacity=64;this.buffer=new Uint8Array(this.bufferCapacity);this.add32=i?.add32||l,this.state={state:[...this.initialMD5State],bytesProcessed:0,bufferLength:0,buffer:this.buffer};}_transform(i,e,r){try{let t=i,s=t.length;if(s===0){r();return}if(this.state.bufferLength>0){let f=this.state.bufferLength,m=64-f,c=Math.min(s,m);for(let b=0;b<c;b++)this.buffer[f+b]=t[b];if(this.state.bufferLength+=c,this.state.bufferLength===64&&this._processBufferBlock(),c===s){r();return}let d=s-c;for(let b=0;b<d;b++)t[b]=t[c+b];let h=Buffer.alloc(d);for(let b=0;b<d;b++)h[b]=t[b];t=h;}let a=Math.floor(t.length/64);for(let f=0;f<a;f++){let m=f*64,c=[];for(let d=0;d<16;d++){let h=m+d*4;c[d]=t[h]+(t[h+1]<<8)+(t[h+2]<<16)+(t[h+3]<<24);}p(this.state.state,c,this.add32),this.state.bytesProcessed+=64;}let u=t.length%64;if(u>0){this.buffer.length<u&&(this.buffer=new Uint8Array(u),this.state.buffer=this.buffer);for(let f=0;f<u;f++)this.buffer[f]=t[a*64+f];this.state.bufferLength=u;}r();}catch(t){r(t);}}_processBufferBlock(){let i=this.state.buffer,e=[];for(let r=0;r<16;r++){let t=r*4;e[r]=i[t]+(i[t+1]<<8)+(i[t+2]<<16)+(i[t+3]<<24);}p(this.state.state,e,this.add32),this.state.bytesProcessed+=64,this.state.bufferLength=0;}_flush(i){try{let{state:e,bufferLength:r,buffer:t}=this.state,s=new Array(16).fill(0);for(let u=0;u<r;u++)s[u>>2]|=(t[u]&255)<<(u%4<<3);if(s[r>>2]|=128<<(r%4<<3),r>55){p(e,s,this.add32);for(let u=0;u<16;u++)s[u]=0;}s[14]=(this.state.bytesProcessed+r)*8,s[15]=0,p(e,s,this.add32);let a=B(e);this.emit("md5",{digest:a,bytesProcessed:this.state.bytesProcessed+r}),i();}catch(e){i(e);}}getCurrentState(){return {state:[...this.state.state],bytesProcessed:this.state.bytesProcessed+this.state.bufferLength}}getBytesProcessed(){return this.state.bytesProcessed+this.state.bufferLength}reset(){this.state={state:[...this.initialMD5State],bytesProcessed:0,bufferLength:0,buffer:this.buffer},this.buffer=new Uint8Array(this.bufferCapacity),this.state.buffer=this.buffer,this.state.bufferLength=0;}static fromStream(i,e){let r=new o(e),t=T.call(r,i);return {stream:r,result:t}}};async function T(o){return new Promise((n,i)=>{let e=[];o.pipe(this).on("md5",r=>{e.push(r);}).on("error",i).on("finish",()=>{n(e[0]);});})}var P=class{constructor(){this.name="stream";this.version="0.1.0";this.state=null;}initNodeStream(n){this.state={stream:n,type:"node"};}initWhatWGStream(n){this.state={stream:n,type:"whatwg"};}async hash(n){let i=new g;return (await new Promise((r,t)=>{i.on("md5",s=>r(s)).on("error",t).end(n);})).digest}async hashBinary(n){let i=new g,e;return n instanceof Uint8Array?e=Buffer.from(n):n instanceof ArrayBuffer?e=Buffer.from(new Uint8Array(n)):e=Buffer.from(n),(await new Promise((t,s)=>{i.on("md5",a=>t(a)).on("error",s).end(e);})).digest}update(n){if(!this.state)throw new Error("Stream backend not initialized. Call initNodeStream() or initWhatWGStream() first.");if(this.state.type==="node"){let i=this.state.stream,e;typeof n=="string"||n instanceof Uint8Array?e=Buffer.from(n):n instanceof ArrayBuffer?e=Buffer.from(new Uint8Array(n)):e=Buffer.from(n),i.write(e);}}digest(n){if(!this.state)throw new Error("Stream backend not initialized. Call initNodeStream() or initWhatWGStream() first.");if(this.state.type==="node"){let i=this.state.stream;return i.end(),new Promise((e,r)=>{i.on("md5",t=>{if(n==="buffer"){let s=t.digest,a=[];for(let u=0;u<s.length;u+=2)a.push(parseInt(s.substring(u,u+2),16));e(Buffer.from(a));}else e(t.digest);}).on("error",r);})}else return this.state.stream.getResult().then(e=>e.digest)}reset(){this.state&&this.state.type==="node"&&this.state.stream.reset();}static isAvailable(){return true}};exports.StreamBackend=P;//# sourceMappingURL=adapter.cjs.map
2
- //# sourceMappingURL=adapter.cjs.map
1
+ 'use strict';var stream=require('stream');function x(o,n){return o+n&4294967295}var l=x;function v(o,n,i,e,r){let t=r||l;return n=t(t(n,o),t(i,e)),n}function L(o,n,i,e){var t=(e||l)(o<<n|o>>>32-n,i);return t}function y(o,n,i,e,r,t,s){return n=v(o,n,e,t,s),L(n,r,i,s)}function M(o,n,i,e,r,t,s,a){return y(i&e|~i&r,n,i,t,s,a,o)}function D(o,n,i,e,r,t,s,a){return y(i&r|e&~r,n,i,t,s,a,o)}function A(o,n,i,e,r,t,s,a){return y(i^e^r,n,i,t,s,a,o)}function w(o,n,i,e,r,t,s,a){return y(e^(i|~r),n,i,t,s,a,o)}function R(o,n,i){typeof i>"u"&&(i=l);let e=o[0],r=o[1],t=o[2],s=o[3],a=M.bind(null,i);e=a(e,r,t,s,n[0],7,-680876936),s=a(s,e,r,t,n[1],12,-389564586),t=a(t,s,e,r,n[2],17,606105819),r=a(r,t,s,e,n[3],22,-1044525330),e=a(e,r,t,s,n[4],7,-176418897),s=a(s,e,r,t,n[5],12,1200080426),t=a(t,s,e,r,n[6],17,-1473231341),r=a(r,t,s,e,n[7],22,-45705983),e=a(e,r,t,s,n[8],7,1770035416),s=a(s,e,r,t,n[9],12,-1958414417),t=a(t,s,e,r,n[10],17,-42063),r=a(r,t,s,e,n[11],22,-1990404162),e=a(e,r,t,s,n[12],7,1804603682),s=a(s,e,r,t,n[13],12,-40341101),t=a(t,s,e,r,n[14],17,-1502002290),r=a(r,t,s,e,n[15],22,1236535329);let u=D.bind(null,i);e=u(e,r,t,s,n[1],5,-165796510),s=u(s,e,r,t,n[6],9,-1069501632),t=u(t,s,e,r,n[11],14,643717713),r=u(r,t,s,e,n[0],20,-373897302),e=u(e,r,t,s,n[5],5,-701558691),s=u(s,e,r,t,n[10],9,38016083),t=u(t,s,e,r,n[15],14,-660478335),r=u(r,t,s,e,n[4],20,-405537848),e=u(e,r,t,s,n[9],5,568446438),s=u(s,e,r,t,n[14],9,-1019803690),t=u(t,s,e,r,n[3],14,-187363961),r=u(r,t,s,e,n[8],20,1163531501),e=u(e,r,t,s,n[13],5,-1444681467),s=u(s,e,r,t,n[2],9,-51403784),t=u(t,s,e,r,n[7],14,1735328473),r=u(r,t,s,e,n[12],20,-1926607734);let f=A.bind(null,i);e=f(e,r,t,s,n[5],4,-378558),s=f(s,e,r,t,n[8],11,-2022574463),t=f(t,s,e,r,n[11],16,1839030562),r=f(r,t,s,e,n[14],23,-35309556),e=f(e,r,t,s,n[1],4,-1530992060),s=f(s,e,r,t,n[4],11,1272893353),t=f(t,s,e,r,n[7],16,-155497632),r=f(r,t,s,e,n[10],23,-1094730640),e=f(e,r,t,s,n[13],4,681279174),s=f(s,e,r,t,n[0],11,-358537222),t=f(t,s,e,r,n[3],16,-722521979),r=f(r,t,s,e,n[6],23,76029189),e=f(e,r,t,s,n[9],4,-640364487),s=f(s,e,r,t,n[12],11,-421815835),t=f(t,s,e,r,n[15],16,530742520),r=f(r,t,s,e,n[2],23,-995338651);let m=w.bind(null,i);e=m(e,r,t,s,n[0],6,-198630844),s=m(s,e,r,t,n[7],10,1126891415),t=m(t,s,e,r,n[14],15,-1416354905),r=m(r,t,s,e,n[5],21,-57434055),e=m(e,r,t,s,n[12],6,1700485571),s=m(s,e,r,t,n[3],10,-1894986606),t=m(t,s,e,r,n[10],15,-1051523),r=m(r,t,s,e,n[1],21,-2054922799),e=m(e,r,t,s,n[8],6,1873313359),s=m(s,e,r,t,n[15],10,-30611744),t=m(t,s,e,r,n[6],15,-1560198380),r=m(r,t,s,e,n[13],21,1309151649),e=m(e,r,t,s,n[4],6,-145523070),s=m(s,e,r,t,n[11],10,-1120210379),t=m(t,s,e,r,n[2],15,718787259),r=m(r,t,s,e,n[9],21,-343485551),o[0]=i(e,o[0]),o[1]=i(r,o[1]),o[2]=i(t,o[2]),o[3]=i(s,o[3]);}var p=R;var W="0123456789abcdef".split(""),S=W;function U(o){let n="";for(let i=0;i<4;i++)n+=S[o>>i*8+4&15]+S[o>>i*8&15];return n}function C(o){let n=o.length,i=new Array(n);for(let e=0;e<n;e++)i[e]=U(o[e]);return i.join("")}var B=C;var g=class o extends stream.Transform{constructor(i){super({readableObjectMode:false,writableObjectMode:false});this.initialMD5State=[1732584193,-271733879,-1732584194,271733878];this.bufferCapacity=64;this.buffer=new Uint8Array(this.bufferCapacity);this.add32=i?.add32||l,this.state={state:[...this.initialMD5State],bytesProcessed:0,bufferLength:0,buffer:this.buffer};}_transform(i,e,r){try{let t=i,s=t.length;if(s===0){r();return}if(this.state.bufferLength>0){let f=this.state.bufferLength,m=64-f,c=Math.min(s,m);for(let b=0;b<c;b++)this.buffer[f+b]=t[b];if(this.state.bufferLength+=c,this.state.bufferLength===64&&this._processBufferBlock(),c===s){r();return}let d=s-c;for(let b=0;b<d;b++)t[b]=t[c+b];let h=Buffer.alloc(d);for(let b=0;b<d;b++)h[b]=t[b];t=h;}let a=Math.floor(t.length/64);for(let f=0;f<a;f++){let m=f*64,c=[];for(let d=0;d<16;d++){let h=m+d*4;c[d]=t[h]+(t[h+1]<<8)+(t[h+2]<<16)+(t[h+3]<<24);}p(this.state.state,c,this.add32),this.state.bytesProcessed+=64;}let u=t.length%64;if(u>0){this.buffer.length<u&&(this.buffer=new Uint8Array(u),this.state.buffer=this.buffer);for(let f=0;f<u;f++)this.buffer[f]=t[a*64+f];this.state.bufferLength=u;}r();}catch(t){r(t);}}_processBufferBlock(){let i=this.state.buffer,e=[];for(let r=0;r<16;r++){let t=r*4;e[r]=i[t]+(i[t+1]<<8)+(i[t+2]<<16)+(i[t+3]<<24);}p(this.state.state,e,this.add32),this.state.bytesProcessed+=64,this.state.bufferLength=0;}_flush(i){try{let{state:e,bufferLength:r,buffer:t}=this.state,s=new Array(16).fill(0);for(let u=0;u<r;u++)s[u>>2]|=(t[u]&255)<<(u%4<<3);if(s[r>>2]|=128<<(r%4<<3),r>55){p(e,s,this.add32);for(let u=0;u<16;u++)s[u]=0;}s[14]=(this.state.bytesProcessed+r)*8,s[15]=0,p(e,s,this.add32);let a=B(e);this.emit("md5",{digest:a,bytesProcessed:this.state.bytesProcessed+r}),i();}catch(e){i(e);}}getCurrentState(){return {state:[...this.state.state],bytesProcessed:this.state.bytesProcessed+this.state.bufferLength}}getBytesProcessed(){return this.state.bytesProcessed+this.state.bufferLength}reset(){this.state={state:[...this.initialMD5State],bytesProcessed:0,bufferLength:0,buffer:this.buffer},this.buffer=new Uint8Array(this.bufferCapacity),this.state.buffer=this.buffer,this.state.bufferLength=0;}static fromStream(i,e){let r=new o(e),t=T.call(r,i);return {stream:r,result:t}}};async function T(o){return new Promise((n,i)=>{let e=[];o.pipe(this).on("md5",r=>{e.push(r);}).on("error",i).on("finish",()=>{n(e[0]);});})}var P=class{constructor(){this.name="stream";this.version="0.1.0";this.state=null;}initNodeStream(n){this.state={stream:n,type:"node"};}initWhatWGStream(n){this.state={stream:n,type:"whatwg"};}async hash(n){let i=new g;return (await new Promise((r,t)=>{i.on("md5",s=>r(s)).on("error",t).end(n);})).digest}async hashBinary(n){let i=new g,e;return n instanceof Uint8Array?e=Buffer.from(n):n instanceof ArrayBuffer?e=Buffer.from(new Uint8Array(n)):e=Buffer.from(n),(await new Promise((t,s)=>{i.on("md5",a=>t(a)).on("error",s).end(e);})).digest}update(n){if(!this.state)throw new Error("Stream backend not initialized. Call initNodeStream() or initWhatWGStream() first.");if(this.state.type==="node"){let i=this.state.stream,e;typeof n=="string"||n instanceof Uint8Array?e=Buffer.from(n):n instanceof ArrayBuffer?e=Buffer.from(new Uint8Array(n)):e=Buffer.from(n),i.write(e);}}digest(n){if(!this.state)throw new Error("Stream backend not initialized. Call initNodeStream() or initWhatWGStream() first.");if(this.state.type==="node"){let i=this.state.stream;return i.end(),new Promise((e,r)=>{i.on("md5",t=>{if(n==="buffer"){let s=t.digest,a=[];for(let u=0;u<s.length;u+=2)a.push(parseInt(s.substring(u,u+2),16));e(Buffer.from(a));}else e(t.digest);}).on("error",r);})}else return this.state.stream.getResult().then(e=>e.digest)}reset(){this.state&&this.state.type==="node"&&this.state.stream.reset();}static isAvailable(){return true}};exports.StreamBackend=P;
@@ -1,2 +1 @@
1
- export{a as StreamBackend}from'../chunk-4KSCMS4Q.js';import'../chunk-JKVD5LHZ.js';import'../chunk-R4JB5MBR.js';import'../chunk-2YXXFGBV.js';//# sourceMappingURL=adapter.js.map
2
- //# sourceMappingURL=adapter.js.map
1
+ export{a as StreamBackend}from'../chunk-Y2ZKN4NS.js';import'../chunk-MIU3X4SB.js';import'../chunk-DFR4GYL3.js';import'../chunk-I7AUKTXE.js';
@@ -1,2 +1 @@
1
- 'use strict';var g=require('fs'),stream=require('stream');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var g__default=/*#__PURE__*/_interopDefault(g);function E(o,n){return o+n&4294967295}var b=E;function C(o,n,i,e,t){let r=t||b;return n=r(r(n,o),r(i,e)),n}function O(o,n,i,e){var r=(e||b)(o<<n|o>>>32-n,i);return r}function y(o,n,i,e,t,r,s){return n=C(o,n,e,r,s),O(n,t,i,s)}function S(o,n,i,e,t,r,s,u){return y(i&e|~i&t,n,i,r,s,u,o)}function D(o,n,i,e,t,r,s,u){return y(i&t|e&~t,n,i,r,s,u,o)}function F(o,n,i,e,t,r,s,u){return y(i^e^t,n,i,r,s,u,o)}function v(o,n,i,e,t,r,s,u){return y(e^(i|~t),n,i,r,s,u,o)}function $(o,n,i){typeof i>"u"&&(i=b);let e=o[0],t=o[1],r=o[2],s=o[3],u=S.bind(null,i);e=u(e,t,r,s,n[0],7,-680876936),s=u(s,e,t,r,n[1],12,-389564586),r=u(r,s,e,t,n[2],17,606105819),t=u(t,r,s,e,n[3],22,-1044525330),e=u(e,t,r,s,n[4],7,-176418897),s=u(s,e,t,r,n[5],12,1200080426),r=u(r,s,e,t,n[6],17,-1473231341),t=u(t,r,s,e,n[7],22,-45705983),e=u(e,t,r,s,n[8],7,1770035416),s=u(s,e,t,r,n[9],12,-1958414417),r=u(r,s,e,t,n[10],17,-42063),t=u(t,r,s,e,n[11],22,-1990404162),e=u(e,t,r,s,n[12],7,1804603682),s=u(s,e,t,r,n[13],12,-40341101),r=u(r,s,e,t,n[14],17,-1502002290),t=u(t,r,s,e,n[15],22,1236535329);let a=D.bind(null,i);e=a(e,t,r,s,n[1],5,-165796510),s=a(s,e,t,r,n[6],9,-1069501632),r=a(r,s,e,t,n[11],14,643717713),t=a(t,r,s,e,n[0],20,-373897302),e=a(e,t,r,s,n[5],5,-701558691),s=a(s,e,t,r,n[10],9,38016083),r=a(r,s,e,t,n[15],14,-660478335),t=a(t,r,s,e,n[4],20,-405537848),e=a(e,t,r,s,n[9],5,568446438),s=a(s,e,t,r,n[14],9,-1019803690),r=a(r,s,e,t,n[3],14,-187363961),t=a(t,r,s,e,n[8],20,1163531501),e=a(e,t,r,s,n[13],5,-1444681467),s=a(s,e,t,r,n[2],9,-51403784),r=a(r,s,e,t,n[7],14,1735328473),t=a(t,r,s,e,n[12],20,-1926607734);let f=F.bind(null,i);e=f(e,t,r,s,n[5],4,-378558),s=f(s,e,t,r,n[8],11,-2022574463),r=f(r,s,e,t,n[11],16,1839030562),t=f(t,r,s,e,n[14],23,-35309556),e=f(e,t,r,s,n[1],4,-1530992060),s=f(s,e,t,r,n[4],11,1272893353),r=f(r,s,e,t,n[7],16,-155497632),t=f(t,r,s,e,n[10],23,-1094730640),e=f(e,t,r,s,n[13],4,681279174),s=f(s,e,t,r,n[0],11,-358537222),r=f(r,s,e,t,n[3],16,-722521979),t=f(t,r,s,e,n[6],23,76029189),e=f(e,t,r,s,n[9],4,-640364487),s=f(s,e,t,r,n[12],11,-421815835),r=f(r,s,e,t,n[15],16,530742520),t=f(t,r,s,e,n[2],23,-995338651);let m=v.bind(null,i);e=m(e,t,r,s,n[0],6,-198630844),s=m(s,e,t,r,n[7],10,1126891415),r=m(r,s,e,t,n[14],15,-1416354905),t=m(t,r,s,e,n[5],21,-57434055),e=m(e,t,r,s,n[12],6,1700485571),s=m(s,e,t,r,n[3],10,-1894986606),r=m(r,s,e,t,n[10],15,-1051523),t=m(t,r,s,e,n[1],21,-2054922799),e=m(e,t,r,s,n[8],6,1873313359),s=m(s,e,t,r,n[15],10,-30611744),r=m(r,s,e,t,n[6],15,-1560198380),t=m(t,r,s,e,n[13],21,1309151649),e=m(e,t,r,s,n[4],6,-145523070),s=m(s,e,t,r,n[11],10,-1120210379),r=m(r,s,e,t,n[2],15,718787259),t=m(t,r,s,e,n[9],21,-343485551),o[0]=i(e,o[0]),o[1]=i(t,o[1]),o[2]=i(r,o[2]),o[3]=i(s,o[3]);}var d=$;var j="0123456789abcdef".split(""),x=j;function T(o){let n="";for(let i=0;i<4;i++)n+=x[o>>i*8+4&15]+x[o>>i*8&15];return n}function _(o){let n=o.length,i=new Array(n);for(let e=0;e<n;e++)i[e]=T(o[e]);return i.join("")}var w=_;var M=class o extends stream.Transform{constructor(i){super({readableObjectMode:false,writableObjectMode:false});this.initialMD5State=[1732584193,-271733879,-1732584194,271733878];this.bufferCapacity=64;this.buffer=new Uint8Array(this.bufferCapacity);this.add32=i?.add32||b,this.state={state:[...this.initialMD5State],bytesProcessed:0,bufferLength:0,buffer:this.buffer};}_transform(i,e,t){try{let r=i,s=r.length;if(s===0){t();return}if(this.state.bufferLength>0){let f=this.state.bufferLength,m=64-f,l=Math.min(s,m);for(let c=0;c<l;c++)this.buffer[f+c]=r[c];if(this.state.bufferLength+=l,this.state.bufferLength===64&&this._processBufferBlock(),l===s){t();return}let h=s-l;for(let c=0;c<h;c++)r[c]=r[l+c];let p=Buffer.alloc(h);for(let c=0;c<h;c++)p[c]=r[c];r=p;}let u=Math.floor(r.length/64);for(let f=0;f<u;f++){let m=f*64,l=[];for(let h=0;h<16;h++){let p=m+h*4;l[h]=r[p]+(r[p+1]<<8)+(r[p+2]<<16)+(r[p+3]<<24);}d(this.state.state,l,this.add32),this.state.bytesProcessed+=64;}let a=r.length%64;if(a>0){this.buffer.length<a&&(this.buffer=new Uint8Array(a),this.state.buffer=this.buffer);for(let f=0;f<a;f++)this.buffer[f]=r[u*64+f];this.state.bufferLength=a;}t();}catch(r){t(r);}}_processBufferBlock(){let i=this.state.buffer,e=[];for(let t=0;t<16;t++){let r=t*4;e[t]=i[r]+(i[r+1]<<8)+(i[r+2]<<16)+(i[r+3]<<24);}d(this.state.state,e,this.add32),this.state.bytesProcessed+=64,this.state.bufferLength=0;}_flush(i){try{let{state:e,bufferLength:t,buffer:r}=this.state,s=new Array(16).fill(0);for(let a=0;a<t;a++)s[a>>2]|=(r[a]&255)<<(a%4<<3);if(s[t>>2]|=128<<(t%4<<3),t>55){d(e,s,this.add32);for(let a=0;a<16;a++)s[a]=0;}s[14]=(this.state.bytesProcessed+t)*8,s[15]=0,d(e,s,this.add32);let u=w(e);this.emit("md5",{digest:u,bytesProcessed:this.state.bytesProcessed+t}),i();}catch(e){i(e);}}getCurrentState(){return {state:[...this.state.state],bytesProcessed:this.state.bytesProcessed+this.state.bufferLength}}getBytesProcessed(){return this.state.bytesProcessed+this.state.bufferLength}reset(){this.state={state:[...this.initialMD5State],bytesProcessed:0,bufferLength:0,buffer:this.buffer},this.buffer=new Uint8Array(this.bufferCapacity),this.state.buffer=this.buffer,this.state.bufferLength=0;}static fromStream(i,e){let t=new o(e),r=U.call(t,i);return {stream:t,result:r}}};function B(o){return new M(o)}async function U(o){return new Promise((n,i)=>{let e=[];o.pipe(this).on("md5",t=>{e.push(t);}).on("error",i).on("finish",()=>{n(e[0]);});})}function H(o,n){let i=o.length,e=[1732584193,-271733879,-1732584194,271733878],t;for(t=64;t<=i;t+=64){let u=I(o,t-64);d(e,u,n);}let r=i-t+64,s=new Array(16).fill(0);for(let u=0;u<r;u++)s[u>>2]|=(o[i-r+u]&255)<<(u%4<<3);if(s[r>>2]|=128<<(r%4<<3),r>55){d(e,s,n);for(let u=0;u<16;u++)s[u]=0;}return s[14]=i*8,s[15]=0,d(e,s,n),e}function I(o,n){let i=[];for(let e=0;e<64;e+=4)i[e>>2]=(o[n+e]||0)+((o[n+e+1]||0)<<8)+((o[n+e+2]||0)<<16)+((o[n+e+3]||0)<<24);return i}var P=H;function A(o){return w(P(o,b))}async function R(o,n={}){if(typeof o!="string"||o.trim()==="")throw new Error("Invalid file path: must be a non-empty string");if(!g__default.default.existsSync(o))throw new Error(`File not found: ${o}`);let i;try{i=g__default.default.statSync(o);}catch(t){throw new Error(`Failed to access file ${o}: ${t.message}`)}if(!i.isFile())throw new Error(`Path is not a file: ${o}`);let e=g__default.default.createReadStream(o,{highWaterMark:n.chunkSize||64*1024});try{return await L(e,{onProgress:n.onProgress,totalSize:i.size})}finally{e.destroy();}}async function L(o,n={}){if(!o||typeof o.on!="function")throw new Error("Invalid readable stream: stream must have event listener support");let i=B(),e=0;return n.onProgress&&o.on("data",t=>{e+=t.length,n.onProgress?.(e);}),o.on("error",t=>{i.destroy(t);}),o.on("end",()=>{i.end();}),new Promise((t,r)=>{i.on("md5",s=>{t(s);}).on("error",s=>{r(s);}),o.pipe(i);})}async function de(o,n={}){return (await R(o,n)).digest}async function le(o,n={}){return (await L(o,n)).digest}async function he(o,n,i={}){return (await R(o,i)).digest.toLowerCase()===n.toLowerCase()}function pe(o){if(typeof o!="string"||o.trim()==="")throw new Error("Invalid file path: must be a non-empty string");if(!g__default.default.existsSync(o))throw new Error(`File not found: ${o}`);let n;try{n=g__default.default.statSync(o);}catch(e){throw new Error(`Failed to access file ${o}: ${e.message}`)}if(!n.isFile())throw new Error(`Path is not a file: ${o}`);let i;try{i=g__default.default.readFileSync(o);}catch(e){throw new Error(`Failed to read file ${o}: ${e.message}`)}return A(i)}function ge(o,n){let i=0;return e=>{if(o>0){let t=Math.min(100,e/o*100);Math.floor(t)!==Math.floor(i)&&(n(t),i=t);}}}exports.createProgressTracker=ge;exports.hashFile=R;exports.hashFileDigest=de;exports.hashFileStream=L;exports.hashFileStreamDigest=le;exports.hashFileSync=pe;exports.verifyFile=he;//# sourceMappingURL=fs-utils.cjs.map
2
- //# sourceMappingURL=fs-utils.cjs.map
1
+ 'use strict';var g=require('fs'),stream=require('stream');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var g__default=/*#__PURE__*/_interopDefault(g);function E(o,n){return o+n&4294967295}var b=E;function C(o,n,i,e,t){let r=t||b;return n=r(r(n,o),r(i,e)),n}function O(o,n,i,e){var r=(e||b)(o<<n|o>>>32-n,i);return r}function y(o,n,i,e,t,r,s){return n=C(o,n,e,r,s),O(n,t,i,s)}function S(o,n,i,e,t,r,s,u){return y(i&e|~i&t,n,i,r,s,u,o)}function D(o,n,i,e,t,r,s,u){return y(i&t|e&~t,n,i,r,s,u,o)}function F(o,n,i,e,t,r,s,u){return y(i^e^t,n,i,r,s,u,o)}function v(o,n,i,e,t,r,s,u){return y(e^(i|~t),n,i,r,s,u,o)}function $(o,n,i){typeof i>"u"&&(i=b);let e=o[0],t=o[1],r=o[2],s=o[3],u=S.bind(null,i);e=u(e,t,r,s,n[0],7,-680876936),s=u(s,e,t,r,n[1],12,-389564586),r=u(r,s,e,t,n[2],17,606105819),t=u(t,r,s,e,n[3],22,-1044525330),e=u(e,t,r,s,n[4],7,-176418897),s=u(s,e,t,r,n[5],12,1200080426),r=u(r,s,e,t,n[6],17,-1473231341),t=u(t,r,s,e,n[7],22,-45705983),e=u(e,t,r,s,n[8],7,1770035416),s=u(s,e,t,r,n[9],12,-1958414417),r=u(r,s,e,t,n[10],17,-42063),t=u(t,r,s,e,n[11],22,-1990404162),e=u(e,t,r,s,n[12],7,1804603682),s=u(s,e,t,r,n[13],12,-40341101),r=u(r,s,e,t,n[14],17,-1502002290),t=u(t,r,s,e,n[15],22,1236535329);let a=D.bind(null,i);e=a(e,t,r,s,n[1],5,-165796510),s=a(s,e,t,r,n[6],9,-1069501632),r=a(r,s,e,t,n[11],14,643717713),t=a(t,r,s,e,n[0],20,-373897302),e=a(e,t,r,s,n[5],5,-701558691),s=a(s,e,t,r,n[10],9,38016083),r=a(r,s,e,t,n[15],14,-660478335),t=a(t,r,s,e,n[4],20,-405537848),e=a(e,t,r,s,n[9],5,568446438),s=a(s,e,t,r,n[14],9,-1019803690),r=a(r,s,e,t,n[3],14,-187363961),t=a(t,r,s,e,n[8],20,1163531501),e=a(e,t,r,s,n[13],5,-1444681467),s=a(s,e,t,r,n[2],9,-51403784),r=a(r,s,e,t,n[7],14,1735328473),t=a(t,r,s,e,n[12],20,-1926607734);let f=F.bind(null,i);e=f(e,t,r,s,n[5],4,-378558),s=f(s,e,t,r,n[8],11,-2022574463),r=f(r,s,e,t,n[11],16,1839030562),t=f(t,r,s,e,n[14],23,-35309556),e=f(e,t,r,s,n[1],4,-1530992060),s=f(s,e,t,r,n[4],11,1272893353),r=f(r,s,e,t,n[7],16,-155497632),t=f(t,r,s,e,n[10],23,-1094730640),e=f(e,t,r,s,n[13],4,681279174),s=f(s,e,t,r,n[0],11,-358537222),r=f(r,s,e,t,n[3],16,-722521979),t=f(t,r,s,e,n[6],23,76029189),e=f(e,t,r,s,n[9],4,-640364487),s=f(s,e,t,r,n[12],11,-421815835),r=f(r,s,e,t,n[15],16,530742520),t=f(t,r,s,e,n[2],23,-995338651);let m=v.bind(null,i);e=m(e,t,r,s,n[0],6,-198630844),s=m(s,e,t,r,n[7],10,1126891415),r=m(r,s,e,t,n[14],15,-1416354905),t=m(t,r,s,e,n[5],21,-57434055),e=m(e,t,r,s,n[12],6,1700485571),s=m(s,e,t,r,n[3],10,-1894986606),r=m(r,s,e,t,n[10],15,-1051523),t=m(t,r,s,e,n[1],21,-2054922799),e=m(e,t,r,s,n[8],6,1873313359),s=m(s,e,t,r,n[15],10,-30611744),r=m(r,s,e,t,n[6],15,-1560198380),t=m(t,r,s,e,n[13],21,1309151649),e=m(e,t,r,s,n[4],6,-145523070),s=m(s,e,t,r,n[11],10,-1120210379),r=m(r,s,e,t,n[2],15,718787259),t=m(t,r,s,e,n[9],21,-343485551),o[0]=i(e,o[0]),o[1]=i(t,o[1]),o[2]=i(r,o[2]),o[3]=i(s,o[3]);}var d=$;var j="0123456789abcdef".split(""),x=j;function T(o){let n="";for(let i=0;i<4;i++)n+=x[o>>i*8+4&15]+x[o>>i*8&15];return n}function _(o){let n=o.length,i=new Array(n);for(let e=0;e<n;e++)i[e]=T(o[e]);return i.join("")}var w=_;var M=class o extends stream.Transform{constructor(i){super({readableObjectMode:false,writableObjectMode:false});this.initialMD5State=[1732584193,-271733879,-1732584194,271733878];this.bufferCapacity=64;this.buffer=new Uint8Array(this.bufferCapacity);this.add32=i?.add32||b,this.state={state:[...this.initialMD5State],bytesProcessed:0,bufferLength:0,buffer:this.buffer};}_transform(i,e,t){try{let r=i,s=r.length;if(s===0){t();return}if(this.state.bufferLength>0){let f=this.state.bufferLength,m=64-f,l=Math.min(s,m);for(let c=0;c<l;c++)this.buffer[f+c]=r[c];if(this.state.bufferLength+=l,this.state.bufferLength===64&&this._processBufferBlock(),l===s){t();return}let h=s-l;for(let c=0;c<h;c++)r[c]=r[l+c];let p=Buffer.alloc(h);for(let c=0;c<h;c++)p[c]=r[c];r=p;}let u=Math.floor(r.length/64);for(let f=0;f<u;f++){let m=f*64,l=[];for(let h=0;h<16;h++){let p=m+h*4;l[h]=r[p]+(r[p+1]<<8)+(r[p+2]<<16)+(r[p+3]<<24);}d(this.state.state,l,this.add32),this.state.bytesProcessed+=64;}let a=r.length%64;if(a>0){this.buffer.length<a&&(this.buffer=new Uint8Array(a),this.state.buffer=this.buffer);for(let f=0;f<a;f++)this.buffer[f]=r[u*64+f];this.state.bufferLength=a;}t();}catch(r){t(r);}}_processBufferBlock(){let i=this.state.buffer,e=[];for(let t=0;t<16;t++){let r=t*4;e[t]=i[r]+(i[r+1]<<8)+(i[r+2]<<16)+(i[r+3]<<24);}d(this.state.state,e,this.add32),this.state.bytesProcessed+=64,this.state.bufferLength=0;}_flush(i){try{let{state:e,bufferLength:t,buffer:r}=this.state,s=new Array(16).fill(0);for(let a=0;a<t;a++)s[a>>2]|=(r[a]&255)<<(a%4<<3);if(s[t>>2]|=128<<(t%4<<3),t>55){d(e,s,this.add32);for(let a=0;a<16;a++)s[a]=0;}s[14]=(this.state.bytesProcessed+t)*8,s[15]=0,d(e,s,this.add32);let u=w(e);this.emit("md5",{digest:u,bytesProcessed:this.state.bytesProcessed+t}),i();}catch(e){i(e);}}getCurrentState(){return {state:[...this.state.state],bytesProcessed:this.state.bytesProcessed+this.state.bufferLength}}getBytesProcessed(){return this.state.bytesProcessed+this.state.bufferLength}reset(){this.state={state:[...this.initialMD5State],bytesProcessed:0,bufferLength:0,buffer:this.buffer},this.buffer=new Uint8Array(this.bufferCapacity),this.state.buffer=this.buffer,this.state.bufferLength=0;}static fromStream(i,e){let t=new o(e),r=U.call(t,i);return {stream:t,result:r}}};function B(o){return new M(o)}async function U(o){return new Promise((n,i)=>{let e=[];o.pipe(this).on("md5",t=>{e.push(t);}).on("error",i).on("finish",()=>{n(e[0]);});})}function H(o,n){let i=o.length,e=[1732584193,-271733879,-1732584194,271733878],t;for(t=64;t<=i;t+=64){let u=I(o,t-64);d(e,u,n);}let r=i-t+64,s=new Array(16).fill(0);for(let u=0;u<r;u++)s[u>>2]|=(o[i-r+u]&255)<<(u%4<<3);if(s[r>>2]|=128<<(r%4<<3),r>55){d(e,s,n);for(let u=0;u<16;u++)s[u]=0;}return s[14]=i*8,s[15]=0,d(e,s,n),e}function I(o,n){let i=[];for(let e=0;e<64;e+=4)i[e>>2]=(o[n+e]||0)+((o[n+e+1]||0)<<8)+((o[n+e+2]||0)<<16)+((o[n+e+3]||0)<<24);return i}var P=H;function A(o){return w(P(o,b))}async function R(o,n={}){if(typeof o!="string"||o.trim()==="")throw new Error("Invalid file path: must be a non-empty string");if(!g__default.default.existsSync(o))throw new Error(`File not found: ${o}`);let i;try{i=g__default.default.statSync(o);}catch(t){throw new Error(`Failed to access file ${o}: ${t.message}`)}if(!i.isFile())throw new Error(`Path is not a file: ${o}`);let e=g__default.default.createReadStream(o,{highWaterMark:n.chunkSize||64*1024});try{return await L(e,{onProgress:n.onProgress,totalSize:i.size})}finally{e.destroy();}}async function L(o,n={}){if(!o||typeof o.on!="function")throw new Error("Invalid readable stream: stream must have event listener support");let i=B(),e=0;return n.onProgress&&o.on("data",t=>{e+=t.length,n.onProgress?.(e);}),o.on("error",t=>{i.destroy(t);}),o.on("end",()=>{i.end();}),new Promise((t,r)=>{i.on("md5",s=>{t(s);}).on("error",s=>{r(s);}),o.pipe(i);})}async function de(o,n={}){return (await R(o,n)).digest}async function le(o,n={}){return (await L(o,n)).digest}async function he(o,n,i={}){return (await R(o,i)).digest.toLowerCase()===n.toLowerCase()}function pe(o){if(typeof o!="string"||o.trim()==="")throw new Error("Invalid file path: must be a non-empty string");if(!g__default.default.existsSync(o))throw new Error(`File not found: ${o}`);let n;try{n=g__default.default.statSync(o);}catch(e){throw new Error(`Failed to access file ${o}: ${e.message}`)}if(!n.isFile())throw new Error(`Path is not a file: ${o}`);let i;try{i=g__default.default.readFileSync(o);}catch(e){throw new Error(`Failed to read file ${o}: ${e.message}`)}return A(i)}function ge(o,n){let i=0;return e=>{if(o>0){let t=Math.min(100,e/o*100);Math.floor(t)!==Math.floor(i)&&(n(t),i=t);}}}exports.createProgressTracker=ge;exports.hashFile=R;exports.hashFileDigest=de;exports.hashFileStream=L;exports.hashFileStreamDigest=le;exports.hashFileSync=pe;exports.verifyFile=he;
@@ -1,2 +1 @@
1
- export{g as createProgressTracker,a as hashFile,c as hashFileDigest,b as hashFileStream,d as hashFileStreamDigest,f as hashFileSync,e as verifyFile}from'../chunk-H2K353LR.js';import'../chunk-NWQ4N5RX.js';import'../chunk-JKVD5LHZ.js';import'../chunk-R4JB5MBR.js';import'../chunk-2YXXFGBV.js';//# sourceMappingURL=fs-utils.js.map
2
- //# sourceMappingURL=fs-utils.js.map
1
+ export{g as createProgressTracker,a as hashFile,c as hashFileDigest,b as hashFileStream,d as hashFileStreamDigest,f as hashFileSync,e as verifyFile}from'../chunk-YDAOGTNB.js';import'../chunk-Z4JB6DTM.js';import'../chunk-MIU3X4SB.js';import'../chunk-DFR4GYL3.js';import'../chunk-I7AUKTXE.js';
@@ -1,2 +1 @@
1
- 'use strict';var stream=require('stream'),D=require('fs');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var D__default=/*#__PURE__*/_interopDefault(D);function U(o,r){return o+r&4294967295}var d=U;function T(o,r,a,e,t){let s=t||d;return r=s(s(r,o),s(a,e)),r}function $(o,r,a,e){var s=(e||d)(o<<r|o>>>32-r,a);return s}function R(o,r,a,e,t,s,n){return r=T(o,r,e,s,n),$(r,t,a,n)}function B(o,r,a,e,t,s,n,i){return R(a&e|~a&t,r,a,s,n,i,o)}function F(o,r,a,e,t,s,n,i){return R(a&t|e&~t,r,a,s,n,i,o)}function A(o,r,a,e,t,s,n,i){return R(a^e^t,r,a,s,n,i,o)}function L(o,r,a,e,t,s,n,i){return R(e^(a|~t),r,a,s,n,i,o)}function j(o,r,a){typeof a>"u"&&(a=d);let e=o[0],t=o[1],s=o[2],n=o[3],i=B.bind(null,a);e=i(e,t,s,n,r[0],7,-680876936),n=i(n,e,t,s,r[1],12,-389564586),s=i(s,n,e,t,r[2],17,606105819),t=i(t,s,n,e,r[3],22,-1044525330),e=i(e,t,s,n,r[4],7,-176418897),n=i(n,e,t,s,r[5],12,1200080426),s=i(s,n,e,t,r[6],17,-1473231341),t=i(t,s,n,e,r[7],22,-45705983),e=i(e,t,s,n,r[8],7,1770035416),n=i(n,e,t,s,r[9],12,-1958414417),s=i(s,n,e,t,r[10],17,-42063),t=i(t,s,n,e,r[11],22,-1990404162),e=i(e,t,s,n,r[12],7,1804603682),n=i(n,e,t,s,r[13],12,-40341101),s=i(s,n,e,t,r[14],17,-1502002290),t=i(t,s,n,e,r[15],22,1236535329);let u=F.bind(null,a);e=u(e,t,s,n,r[1],5,-165796510),n=u(n,e,t,s,r[6],9,-1069501632),s=u(s,n,e,t,r[11],14,643717713),t=u(t,s,n,e,r[0],20,-373897302),e=u(e,t,s,n,r[5],5,-701558691),n=u(n,e,t,s,r[10],9,38016083),s=u(s,n,e,t,r[15],14,-660478335),t=u(t,s,n,e,r[4],20,-405537848),e=u(e,t,s,n,r[9],5,568446438),n=u(n,e,t,s,r[14],9,-1019803690),s=u(s,n,e,t,r[3],14,-187363961),t=u(t,s,n,e,r[8],20,1163531501),e=u(e,t,s,n,r[13],5,-1444681467),n=u(n,e,t,s,r[2],9,-51403784),s=u(s,n,e,t,r[7],14,1735328473),t=u(t,s,n,e,r[12],20,-1926607734);let f=A.bind(null,a);e=f(e,t,s,n,r[5],4,-378558),n=f(n,e,t,s,r[8],11,-2022574463),s=f(s,n,e,t,r[11],16,1839030562),t=f(t,s,n,e,r[14],23,-35309556),e=f(e,t,s,n,r[1],4,-1530992060),n=f(n,e,t,s,r[4],11,1272893353),s=f(s,n,e,t,r[7],16,-155497632),t=f(t,s,n,e,r[10],23,-1094730640),e=f(e,t,s,n,r[13],4,681279174),n=f(n,e,t,s,r[0],11,-358537222),s=f(s,n,e,t,r[3],16,-722521979),t=f(t,s,n,e,r[6],23,76029189),e=f(e,t,s,n,r[9],4,-640364487),n=f(n,e,t,s,r[12],11,-421815835),s=f(s,n,e,t,r[15],16,530742520),t=f(t,s,n,e,r[2],23,-995338651);let m=L.bind(null,a);e=m(e,t,s,n,r[0],6,-198630844),n=m(n,e,t,s,r[7],10,1126891415),s=m(s,n,e,t,r[14],15,-1416354905),t=m(t,s,n,e,r[5],21,-57434055),e=m(e,t,s,n,r[12],6,1700485571),n=m(n,e,t,s,r[3],10,-1894986606),s=m(s,n,e,t,r[10],15,-1051523),t=m(t,s,n,e,r[1],21,-2054922799),e=m(e,t,s,n,r[8],6,1873313359),n=m(n,e,t,s,r[15],10,-30611744),s=m(s,n,e,t,r[6],15,-1560198380),t=m(t,s,n,e,r[13],21,1309151649),e=m(e,t,s,n,r[4],6,-145523070),n=m(n,e,t,s,r[11],10,-1120210379),s=m(s,n,e,t,r[2],15,718787259),t=m(t,s,n,e,r[9],21,-343485551),o[0]=a(e,o[0]),o[1]=a(t,o[1]),o[2]=a(s,o[2]),o[3]=a(n,o[3]);}var b=j;var z="0123456789abcdef".split(""),S=z;function H(o){let r="";for(let a=0;a<4;a++)r+=S[o>>a*8+4&15]+S[o>>a*8&15];return r}function _(o){let r=o.length,a=new Array(r);for(let e=0;e<r;e++)a[e]=H(o[e]);return a.join("")}var g=_;var M=class o extends stream.Transform{constructor(a){super({readableObjectMode:false,writableObjectMode:false});this.initialMD5State=[1732584193,-271733879,-1732584194,271733878];this.bufferCapacity=64;this.buffer=new Uint8Array(this.bufferCapacity);this.add32=a?.add32||d,this.state={state:[...this.initialMD5State],bytesProcessed:0,bufferLength:0,buffer:this.buffer};}_transform(a,e,t){try{let s=a,n=s.length;if(n===0){t();return}if(this.state.bufferLength>0){let f=this.state.bufferLength,m=64-f,l=Math.min(n,m);for(let c=0;c<l;c++)this.buffer[f+c]=s[c];if(this.state.bufferLength+=l,this.state.bufferLength===64&&this._processBufferBlock(),l===n){t();return}let h=n-l;for(let c=0;c<h;c++)s[c]=s[l+c];let y=Buffer.alloc(h);for(let c=0;c<h;c++)y[c]=s[c];s=y;}let i=Math.floor(s.length/64);for(let f=0;f<i;f++){let m=f*64,l=[];for(let h=0;h<16;h++){let y=m+h*4;l[h]=s[y]+(s[y+1]<<8)+(s[y+2]<<16)+(s[y+3]<<24);}b(this.state.state,l,this.add32),this.state.bytesProcessed+=64;}let u=s.length%64;if(u>0){this.buffer.length<u&&(this.buffer=new Uint8Array(u),this.state.buffer=this.buffer);for(let f=0;f<u;f++)this.buffer[f]=s[i*64+f];this.state.bufferLength=u;}t();}catch(s){t(s);}}_processBufferBlock(){let a=this.state.buffer,e=[];for(let t=0;t<16;t++){let s=t*4;e[t]=a[s]+(a[s+1]<<8)+(a[s+2]<<16)+(a[s+3]<<24);}b(this.state.state,e,this.add32),this.state.bytesProcessed+=64,this.state.bufferLength=0;}_flush(a){try{let{state:e,bufferLength:t,buffer:s}=this.state,n=new Array(16).fill(0);for(let u=0;u<t;u++)n[u>>2]|=(s[u]&255)<<(u%4<<3);if(n[t>>2]|=128<<(t%4<<3),t>55){b(e,n,this.add32);for(let u=0;u<16;u++)n[u]=0;}n[14]=(this.state.bytesProcessed+t)*8,n[15]=0,b(e,n,this.add32);let i=g(e);this.emit("md5",{digest:i,bytesProcessed:this.state.bytesProcessed+t}),a();}catch(e){a(e);}}getCurrentState(){return {state:[...this.state.state],bytesProcessed:this.state.bytesProcessed+this.state.bufferLength}}getBytesProcessed(){return this.state.bytesProcessed+this.state.bufferLength}reset(){this.state={state:[...this.initialMD5State],bytesProcessed:0,bufferLength:0,buffer:this.buffer},this.buffer=new Uint8Array(this.bufferCapacity),this.state.buffer=this.buffer,this.state.bufferLength=0;}static fromStream(a,e){let t=new o(e),s=x.call(t,a);return {stream:t,result:s}}};function w(o){return new M(o)}async function x(o){return new Promise((r,a)=>{let e=[];o.pipe(this).on("md5",t=>{e.push(t);}).on("error",a).on("finish",()=>{r(e[0]);});})}function O(o,r){let a=new M(r),e=x.call(a,o);return {stream:a,result:e}}function I(o,r){let a=o.length,e=[1732584193,-271733879,-1732584194,271733878],t;for(t=64;t<=a;t+=64){let i=q(o,t-64);b(e,i,r);}let s=a-t+64,n=new Array(16).fill(0);for(let i=0;i<s;i++)n[i>>2]|=(o[a-s+i]&255)<<(i%4<<3);if(n[s>>2]|=128<<(s%4<<3),s>55){b(e,n,r);for(let i=0;i<16;i++)n[i]=0;}return n[14]=a*8,n[15]=0,b(e,n,r),e}function q(o,r){let a=[];for(let e=0;e<64;e+=4)a[e>>2]=(o[r+e]||0)+((o[r+e+1]||0)<<8)+((o[r+e+2]||0)<<16)+((o[r+e+3]||0)<<24);return a}var C=I;function E(o){return g(C(o,d))}async function P(o,r={}){if(typeof o!="string"||o.trim()==="")throw new Error("Invalid file path: must be a non-empty string");if(!D__default.default.existsSync(o))throw new Error(`File not found: ${o}`);let a;try{a=D__default.default.statSync(o);}catch(t){throw new Error(`Failed to access file ${o}: ${t.message}`)}if(!a.isFile())throw new Error(`Path is not a file: ${o}`);let e=D__default.default.createReadStream(o,{highWaterMark:r.chunkSize||64*1024});try{return await v(e,{onProgress:r.onProgress,totalSize:a.size})}finally{e.destroy();}}async function v(o,r={}){if(!o||typeof o.on!="function")throw new Error("Invalid readable stream: stream must have event listener support");let a=w(),e=0;return r.onProgress&&o.on("data",t=>{e+=t.length,r.onProgress?.(e);}),o.on("error",t=>{a.destroy(t);}),o.on("end",()=>{a.end();}),new Promise((t,s)=>{a.on("md5",n=>{t(n);}).on("error",n=>{s(n);}),o.pipe(a);})}async function G(o,r={}){return (await P(o,r)).digest}async function J(o,r={}){return (await v(o,r)).digest}async function K(o,r,a={}){return (await P(o,a)).digest.toLowerCase()===r.toLowerCase()}function N(o){if(typeof o!="string"||o.trim()==="")throw new Error("Invalid file path: must be a non-empty string");if(!D__default.default.existsSync(o))throw new Error(`File not found: ${o}`);let r;try{r=D__default.default.statSync(o);}catch(e){throw new Error(`Failed to access file ${o}: ${e.message}`)}if(!r.isFile())throw new Error(`Path is not a file: ${o}`);let a;try{a=D__default.default.readFileSync(o);}catch(e){throw new Error(`Failed to read file ${o}: ${e.message}`)}return E(a)}function Q(o,r){let a=0;return e=>{if(o>0){let t=Math.min(100,e/o*100);Math.floor(t)!==Math.floor(a)&&(r(t),a=t);}}}var V=[1732584193,-271733879,-1732584194,271733878],p=class o{constructor(r,a={}){this.result=null;this.resultResolver=null;this.consumed=false;this.bufferCapacity=64;this.buffer=new Uint8Array(this.bufferCapacity);this.sourceStream=r,this.state={state:[...V],bytesProcessed:0,bufferLength:0,buffer:this.buffer},this.add32=a.add32||d,this.resultPromise=new Promise(e=>{this.resultResolver=e;});}getReader(){if(this.consumed)throw new Error("Cannot get reader from MD5ReadableStream: stream has already been consumed");this.consumed=true;let{readable:r,writable:a}=new TransformStream({transform:async(e,t)=>{await this.processChunk(e),t.enqueue(e);},flush:async e=>{this.finalize(),this.resultResolver&&this.resultResolver(this.result);}});return this.sourceStream.pipeTo(a).catch(e=>{console.error("Error piping stream:",e),this.resultResolver&&this.resultResolver({digest:"",bytesProcessed:this.state.bytesProcessed});}),r.getReader()}async processChunk(r){let a;r instanceof Blob?a=new Uint8Array(await r.arrayBuffer()):r instanceof ArrayBuffer?a=new Uint8Array(r):a=r;let e=a.length;if(e===0)return;if(this.state.bufferLength>0){let n=this.state.bufferLength,i=64-n,u=Math.min(e,i);for(let l=0;l<u;l++)this.buffer[n+l]=a[l];if(this.state.bufferLength+=u,this.state.bufferLength===64&&this._processBufferBlock(),u===e)return;let f=e-u,m=new Uint8Array(f);for(let l=0;l<f;l++)m[l]=a[u+l];a=m;}let t=Math.floor(a.length/64);for(let n=0;n<t;n++){let i=n*64,u=[];for(let f=0;f<16;f++){let m=i+f*4;u[f]=a[m]+(a[m+1]<<8)+(a[m+2]<<16)+(a[m+3]<<24);}b(this.state.state,u,this.add32),this.state.bytesProcessed+=64;}let s=a.length%64;if(s>0){this.buffer.length<s&&(this.buffer=new Uint8Array(s),this.state.buffer=this.buffer);for(let n=0;n<s;n++)this.buffer[n]=a[t+n];this.state.bufferLength=s;}}_processBufferBlock(){let r=this.state.buffer,a=[];for(let e=0;e<16;e++){let t=e*4;a[e]=r[t]+(r[t+1]<<8)+(r[t+2]<<16)+(r[t+3]<<24);}b(this.state.state,a,this.add32),this.state.bytesProcessed+=64,this.state.bufferLength=0;}finalize(){let{state:r,bufferLength:a,buffer:e}=this.state,t=new Array(16).fill(0);for(let n=0;n<a;n++)t[n>>2]|=(e[n]&255)<<(n%4<<3);if(t[a>>2]|=128<<(a%4<<3),a>55){b(r,t,this.add32);for(let n=0;n<16;n++)t[n]=0;}t[14]=(this.state.bytesProcessed+a)*8,t[15]=0,b(r,t,this.add32);let s=g(r);this.result={digest:s,bytesProcessed:this.state.bytesProcessed+a};}getResult(){return this.resultPromise}getCurrentState(){return {state:[...this.state.state],bytesProcessed:this.state.bytesProcessed+this.state.bufferLength}}getBytesProcessed(){return this.state.bytesProcessed+this.state.bufferLength}static hash(r,a){let e=new o(r,a),t=e.getReader();return new Promise((s,n)=>{let i=0;t.read().then(function u({done:f,value:m}){if(f){s(e.getResult());return}i+=m.length,t.read().then(u);}).catch(n);})}static hashFile(r,a){let e=r.stream();return o.hash(e,a)}static hashBlob(r,a){return new Promise((e,t)=>{let s=new FileReader;s.onload=n=>{try{let i=n.target?.result,u=new ReadableStream({start(f){f.enqueue(new Uint8Array(i)),f.close();}});e(o.hash(u,a));}catch(i){t(i);}},s.onerror=()=>t(s.error),s.readAsArrayBuffer(r);})}};function X(o,r){return new p(o,r)}async function Y(o,r){let a=o.getReader(),e=new p(o,r),t=0;for(;;){let{done:s,value:n}=await a.read();if(s)break;n&&(t+=n.length);}return e.getResult()}async function Z(o,r){return p.hashFile(o,r)}async function k(o,r){return p.hashBlob(o,r)}async function ee(o,r){let a=o.getReader(),e=new p(o,r),t=0;for(;;){let{done:s,value:n}=await a.read();if(s)break;n&&(t+=n.length);}return e.getResult()}Object.defineProperty(M,"fromStream",{value:O,writable:false,configurable:false});exports.MD5ReadableStream=p;exports.MD5Stream=M;exports.consumeWithMD5=ee;exports.createMD5ReadableStream=X;exports.createMD5Stream=w;exports.createProgressTracker=Q;exports.fromStream=O;exports.hashBlob=k;exports.hashFile=P;exports.hashFileDigest=G;exports.hashFileStream=v;exports.hashFileStreamDigest=J;exports.hashFileSync=N;exports.hashFileWHATWG=Z;exports.hashReadableStream=Y;exports.pipeThroughMD5=x;exports.verifyFile=K;//# sourceMappingURL=index.cjs.map
2
- //# sourceMappingURL=index.cjs.map
1
+ 'use strict';var stream=require('stream'),D=require('fs');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var D__default=/*#__PURE__*/_interopDefault(D);function U(o,r){return o+r&4294967295}var d=U;function T(o,r,a,e,t){let s=t||d;return r=s(s(r,o),s(a,e)),r}function $(o,r,a,e){var s=(e||d)(o<<r|o>>>32-r,a);return s}function R(o,r,a,e,t,s,n){return r=T(o,r,e,s,n),$(r,t,a,n)}function B(o,r,a,e,t,s,n,i){return R(a&e|~a&t,r,a,s,n,i,o)}function F(o,r,a,e,t,s,n,i){return R(a&t|e&~t,r,a,s,n,i,o)}function A(o,r,a,e,t,s,n,i){return R(a^e^t,r,a,s,n,i,o)}function L(o,r,a,e,t,s,n,i){return R(e^(a|~t),r,a,s,n,i,o)}function j(o,r,a){typeof a>"u"&&(a=d);let e=o[0],t=o[1],s=o[2],n=o[3],i=B.bind(null,a);e=i(e,t,s,n,r[0],7,-680876936),n=i(n,e,t,s,r[1],12,-389564586),s=i(s,n,e,t,r[2],17,606105819),t=i(t,s,n,e,r[3],22,-1044525330),e=i(e,t,s,n,r[4],7,-176418897),n=i(n,e,t,s,r[5],12,1200080426),s=i(s,n,e,t,r[6],17,-1473231341),t=i(t,s,n,e,r[7],22,-45705983),e=i(e,t,s,n,r[8],7,1770035416),n=i(n,e,t,s,r[9],12,-1958414417),s=i(s,n,e,t,r[10],17,-42063),t=i(t,s,n,e,r[11],22,-1990404162),e=i(e,t,s,n,r[12],7,1804603682),n=i(n,e,t,s,r[13],12,-40341101),s=i(s,n,e,t,r[14],17,-1502002290),t=i(t,s,n,e,r[15],22,1236535329);let u=F.bind(null,a);e=u(e,t,s,n,r[1],5,-165796510),n=u(n,e,t,s,r[6],9,-1069501632),s=u(s,n,e,t,r[11],14,643717713),t=u(t,s,n,e,r[0],20,-373897302),e=u(e,t,s,n,r[5],5,-701558691),n=u(n,e,t,s,r[10],9,38016083),s=u(s,n,e,t,r[15],14,-660478335),t=u(t,s,n,e,r[4],20,-405537848),e=u(e,t,s,n,r[9],5,568446438),n=u(n,e,t,s,r[14],9,-1019803690),s=u(s,n,e,t,r[3],14,-187363961),t=u(t,s,n,e,r[8],20,1163531501),e=u(e,t,s,n,r[13],5,-1444681467),n=u(n,e,t,s,r[2],9,-51403784),s=u(s,n,e,t,r[7],14,1735328473),t=u(t,s,n,e,r[12],20,-1926607734);let f=A.bind(null,a);e=f(e,t,s,n,r[5],4,-378558),n=f(n,e,t,s,r[8],11,-2022574463),s=f(s,n,e,t,r[11],16,1839030562),t=f(t,s,n,e,r[14],23,-35309556),e=f(e,t,s,n,r[1],4,-1530992060),n=f(n,e,t,s,r[4],11,1272893353),s=f(s,n,e,t,r[7],16,-155497632),t=f(t,s,n,e,r[10],23,-1094730640),e=f(e,t,s,n,r[13],4,681279174),n=f(n,e,t,s,r[0],11,-358537222),s=f(s,n,e,t,r[3],16,-722521979),t=f(t,s,n,e,r[6],23,76029189),e=f(e,t,s,n,r[9],4,-640364487),n=f(n,e,t,s,r[12],11,-421815835),s=f(s,n,e,t,r[15],16,530742520),t=f(t,s,n,e,r[2],23,-995338651);let m=L.bind(null,a);e=m(e,t,s,n,r[0],6,-198630844),n=m(n,e,t,s,r[7],10,1126891415),s=m(s,n,e,t,r[14],15,-1416354905),t=m(t,s,n,e,r[5],21,-57434055),e=m(e,t,s,n,r[12],6,1700485571),n=m(n,e,t,s,r[3],10,-1894986606),s=m(s,n,e,t,r[10],15,-1051523),t=m(t,s,n,e,r[1],21,-2054922799),e=m(e,t,s,n,r[8],6,1873313359),n=m(n,e,t,s,r[15],10,-30611744),s=m(s,n,e,t,r[6],15,-1560198380),t=m(t,s,n,e,r[13],21,1309151649),e=m(e,t,s,n,r[4],6,-145523070),n=m(n,e,t,s,r[11],10,-1120210379),s=m(s,n,e,t,r[2],15,718787259),t=m(t,s,n,e,r[9],21,-343485551),o[0]=a(e,o[0]),o[1]=a(t,o[1]),o[2]=a(s,o[2]),o[3]=a(n,o[3]);}var b=j;var z="0123456789abcdef".split(""),S=z;function H(o){let r="";for(let a=0;a<4;a++)r+=S[o>>a*8+4&15]+S[o>>a*8&15];return r}function _(o){let r=o.length,a=new Array(r);for(let e=0;e<r;e++)a[e]=H(o[e]);return a.join("")}var g=_;var M=class o extends stream.Transform{constructor(a){super({readableObjectMode:false,writableObjectMode:false});this.initialMD5State=[1732584193,-271733879,-1732584194,271733878];this.bufferCapacity=64;this.buffer=new Uint8Array(this.bufferCapacity);this.add32=a?.add32||d,this.state={state:[...this.initialMD5State],bytesProcessed:0,bufferLength:0,buffer:this.buffer};}_transform(a,e,t){try{let s=a,n=s.length;if(n===0){t();return}if(this.state.bufferLength>0){let f=this.state.bufferLength,m=64-f,l=Math.min(n,m);for(let c=0;c<l;c++)this.buffer[f+c]=s[c];if(this.state.bufferLength+=l,this.state.bufferLength===64&&this._processBufferBlock(),l===n){t();return}let h=n-l;for(let c=0;c<h;c++)s[c]=s[l+c];let y=Buffer.alloc(h);for(let c=0;c<h;c++)y[c]=s[c];s=y;}let i=Math.floor(s.length/64);for(let f=0;f<i;f++){let m=f*64,l=[];for(let h=0;h<16;h++){let y=m+h*4;l[h]=s[y]+(s[y+1]<<8)+(s[y+2]<<16)+(s[y+3]<<24);}b(this.state.state,l,this.add32),this.state.bytesProcessed+=64;}let u=s.length%64;if(u>0){this.buffer.length<u&&(this.buffer=new Uint8Array(u),this.state.buffer=this.buffer);for(let f=0;f<u;f++)this.buffer[f]=s[i*64+f];this.state.bufferLength=u;}t();}catch(s){t(s);}}_processBufferBlock(){let a=this.state.buffer,e=[];for(let t=0;t<16;t++){let s=t*4;e[t]=a[s]+(a[s+1]<<8)+(a[s+2]<<16)+(a[s+3]<<24);}b(this.state.state,e,this.add32),this.state.bytesProcessed+=64,this.state.bufferLength=0;}_flush(a){try{let{state:e,bufferLength:t,buffer:s}=this.state,n=new Array(16).fill(0);for(let u=0;u<t;u++)n[u>>2]|=(s[u]&255)<<(u%4<<3);if(n[t>>2]|=128<<(t%4<<3),t>55){b(e,n,this.add32);for(let u=0;u<16;u++)n[u]=0;}n[14]=(this.state.bytesProcessed+t)*8,n[15]=0,b(e,n,this.add32);let i=g(e);this.emit("md5",{digest:i,bytesProcessed:this.state.bytesProcessed+t}),a();}catch(e){a(e);}}getCurrentState(){return {state:[...this.state.state],bytesProcessed:this.state.bytesProcessed+this.state.bufferLength}}getBytesProcessed(){return this.state.bytesProcessed+this.state.bufferLength}reset(){this.state={state:[...this.initialMD5State],bytesProcessed:0,bufferLength:0,buffer:this.buffer},this.buffer=new Uint8Array(this.bufferCapacity),this.state.buffer=this.buffer,this.state.bufferLength=0;}static fromStream(a,e){let t=new o(e),s=x.call(t,a);return {stream:t,result:s}}};function w(o){return new M(o)}async function x(o){return new Promise((r,a)=>{let e=[];o.pipe(this).on("md5",t=>{e.push(t);}).on("error",a).on("finish",()=>{r(e[0]);});})}function O(o,r){let a=new M(r),e=x.call(a,o);return {stream:a,result:e}}function I(o,r){let a=o.length,e=[1732584193,-271733879,-1732584194,271733878],t;for(t=64;t<=a;t+=64){let i=q(o,t-64);b(e,i,r);}let s=a-t+64,n=new Array(16).fill(0);for(let i=0;i<s;i++)n[i>>2]|=(o[a-s+i]&255)<<(i%4<<3);if(n[s>>2]|=128<<(s%4<<3),s>55){b(e,n,r);for(let i=0;i<16;i++)n[i]=0;}return n[14]=a*8,n[15]=0,b(e,n,r),e}function q(o,r){let a=[];for(let e=0;e<64;e+=4)a[e>>2]=(o[r+e]||0)+((o[r+e+1]||0)<<8)+((o[r+e+2]||0)<<16)+((o[r+e+3]||0)<<24);return a}var C=I;function E(o){return g(C(o,d))}async function P(o,r={}){if(typeof o!="string"||o.trim()==="")throw new Error("Invalid file path: must be a non-empty string");if(!D__default.default.existsSync(o))throw new Error(`File not found: ${o}`);let a;try{a=D__default.default.statSync(o);}catch(t){throw new Error(`Failed to access file ${o}: ${t.message}`)}if(!a.isFile())throw new Error(`Path is not a file: ${o}`);let e=D__default.default.createReadStream(o,{highWaterMark:r.chunkSize||64*1024});try{return await v(e,{onProgress:r.onProgress,totalSize:a.size})}finally{e.destroy();}}async function v(o,r={}){if(!o||typeof o.on!="function")throw new Error("Invalid readable stream: stream must have event listener support");let a=w(),e=0;return r.onProgress&&o.on("data",t=>{e+=t.length,r.onProgress?.(e);}),o.on("error",t=>{a.destroy(t);}),o.on("end",()=>{a.end();}),new Promise((t,s)=>{a.on("md5",n=>{t(n);}).on("error",n=>{s(n);}),o.pipe(a);})}async function G(o,r={}){return (await P(o,r)).digest}async function J(o,r={}){return (await v(o,r)).digest}async function K(o,r,a={}){return (await P(o,a)).digest.toLowerCase()===r.toLowerCase()}function N(o){if(typeof o!="string"||o.trim()==="")throw new Error("Invalid file path: must be a non-empty string");if(!D__default.default.existsSync(o))throw new Error(`File not found: ${o}`);let r;try{r=D__default.default.statSync(o);}catch(e){throw new Error(`Failed to access file ${o}: ${e.message}`)}if(!r.isFile())throw new Error(`Path is not a file: ${o}`);let a;try{a=D__default.default.readFileSync(o);}catch(e){throw new Error(`Failed to read file ${o}: ${e.message}`)}return E(a)}function Q(o,r){let a=0;return e=>{if(o>0){let t=Math.min(100,e/o*100);Math.floor(t)!==Math.floor(a)&&(r(t),a=t);}}}var V=[1732584193,-271733879,-1732584194,271733878],p=class o{constructor(r,a={}){this.result=null;this.resultResolver=null;this.consumed=false;this.bufferCapacity=64;this.buffer=new Uint8Array(this.bufferCapacity);this.sourceStream=r,this.state={state:[...V],bytesProcessed:0,bufferLength:0,buffer:this.buffer},this.add32=a.add32||d,this.resultPromise=new Promise(e=>{this.resultResolver=e;});}getReader(){if(this.consumed)throw new Error("Cannot get reader from MD5ReadableStream: stream has already been consumed");this.consumed=true;let{readable:r,writable:a}=new TransformStream({transform:async(e,t)=>{await this.processChunk(e),t.enqueue(e);},flush:async e=>{this.finalize(),this.resultResolver&&this.resultResolver(this.result);}});return this.sourceStream.pipeTo(a).catch(e=>{console.error("Error piping stream:",e),this.resultResolver&&this.resultResolver({digest:"",bytesProcessed:this.state.bytesProcessed});}),r.getReader()}async processChunk(r){let a;r instanceof Blob?a=new Uint8Array(await r.arrayBuffer()):r instanceof ArrayBuffer?a=new Uint8Array(r):a=r;let e=a.length;if(e===0)return;if(this.state.bufferLength>0){let n=this.state.bufferLength,i=64-n,u=Math.min(e,i);for(let l=0;l<u;l++)this.buffer[n+l]=a[l];if(this.state.bufferLength+=u,this.state.bufferLength===64&&this._processBufferBlock(),u===e)return;let f=e-u,m=new Uint8Array(f);for(let l=0;l<f;l++)m[l]=a[u+l];a=m;}let t=Math.floor(a.length/64);for(let n=0;n<t;n++){let i=n*64,u=[];for(let f=0;f<16;f++){let m=i+f*4;u[f]=a[m]+(a[m+1]<<8)+(a[m+2]<<16)+(a[m+3]<<24);}b(this.state.state,u,this.add32),this.state.bytesProcessed+=64;}let s=a.length%64;if(s>0){this.buffer.length<s&&(this.buffer=new Uint8Array(s),this.state.buffer=this.buffer);for(let n=0;n<s;n++)this.buffer[n]=a[t+n];this.state.bufferLength=s;}}_processBufferBlock(){let r=this.state.buffer,a=[];for(let e=0;e<16;e++){let t=e*4;a[e]=r[t]+(r[t+1]<<8)+(r[t+2]<<16)+(r[t+3]<<24);}b(this.state.state,a,this.add32),this.state.bytesProcessed+=64,this.state.bufferLength=0;}finalize(){let{state:r,bufferLength:a,buffer:e}=this.state,t=new Array(16).fill(0);for(let n=0;n<a;n++)t[n>>2]|=(e[n]&255)<<(n%4<<3);if(t[a>>2]|=128<<(a%4<<3),a>55){b(r,t,this.add32);for(let n=0;n<16;n++)t[n]=0;}t[14]=(this.state.bytesProcessed+a)*8,t[15]=0,b(r,t,this.add32);let s=g(r);this.result={digest:s,bytesProcessed:this.state.bytesProcessed+a};}getResult(){return this.resultPromise}getCurrentState(){return {state:[...this.state.state],bytesProcessed:this.state.bytesProcessed+this.state.bufferLength}}getBytesProcessed(){return this.state.bytesProcessed+this.state.bufferLength}static hash(r,a){let e=new o(r,a),t=e.getReader();return new Promise((s,n)=>{let i=0;t.read().then(function u({done:f,value:m}){if(f){s(e.getResult());return}i+=m.length,t.read().then(u);}).catch(n);})}static hashFile(r,a){let e=r.stream();return o.hash(e,a)}static hashBlob(r,a){return new Promise((e,t)=>{let s=new FileReader;s.onload=n=>{try{let i=n.target?.result,u=new ReadableStream({start(f){f.enqueue(new Uint8Array(i)),f.close();}});e(o.hash(u,a));}catch(i){t(i);}},s.onerror=()=>t(s.error),s.readAsArrayBuffer(r);})}};function X(o,r){return new p(o,r)}async function Y(o,r){let a=o.getReader(),e=new p(o,r),t=0;for(;;){let{done:s,value:n}=await a.read();if(s)break;n&&(t+=n.length);}return e.getResult()}async function Z(o,r){return p.hashFile(o,r)}async function k(o,r){return p.hashBlob(o,r)}async function ee(o,r){let a=o.getReader(),e=new p(o,r),t=0;for(;;){let{done:s,value:n}=await a.read();if(s)break;n&&(t+=n.length);}return e.getResult()}Object.defineProperty(M,"fromStream",{value:O,writable:false,configurable:false});exports.MD5ReadableStream=p;exports.MD5Stream=M;exports.consumeWithMD5=ee;exports.createMD5ReadableStream=X;exports.createMD5Stream=w;exports.createProgressTracker=Q;exports.fromStream=O;exports.hashBlob=k;exports.hashFile=P;exports.hashFileDigest=G;exports.hashFileStream=v;exports.hashFileStreamDigest=J;exports.hashFileSync=N;exports.hashFileWHATWG=Z;exports.hashReadableStream=Y;exports.pipeThroughMD5=x;exports.verifyFile=K;
@@ -1,2 +1 @@
1
- import'../chunk-PHZ7FTYF.js';export{a as MD5ReadableStream,f as consumeWithMD5,b as createMD5ReadableStream,e as hashBlob,d as hashFileWHATWG,c as hashReadableStream}from'../chunk-XB5BQIEX.js';export{g as createProgressTracker,a as hashFile,c as hashFileDigest,b as hashFileStream,d as hashFileStreamDigest,f as hashFileSync,e as verifyFile}from'../chunk-H2K353LR.js';import'../chunk-NWQ4N5RX.js';export{a as MD5Stream,b as createMD5Stream,d as fromStream,c as pipeThroughMD5}from'../chunk-JKVD5LHZ.js';import'../chunk-R4JB5MBR.js';import'../chunk-2YXXFGBV.js';//# sourceMappingURL=index.js.map
2
- //# sourceMappingURL=index.js.map
1
+ import'../chunk-374HUUY2.js';export{a as MD5ReadableStream,f as consumeWithMD5,b as createMD5ReadableStream,e as hashBlob,d as hashFileWHATWG,c as hashReadableStream}from'../chunk-BEGGPFEE.js';export{g as createProgressTracker,a as hashFile,c as hashFileDigest,b as hashFileStream,d as hashFileStreamDigest,f as hashFileSync,e as verifyFile}from'../chunk-YDAOGTNB.js';import'../chunk-Z4JB6DTM.js';export{a as MD5Stream,b as createMD5Stream,d as fromStream,c as pipeThroughMD5}from'../chunk-MIU3X4SB.js';import'../chunk-DFR4GYL3.js';import'../chunk-I7AUKTXE.js';
@@ -1,2 +1 @@
1
- 'use strict';var stream=require('stream'),M=require('fs');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var M__default=/*#__PURE__*/_interopDefault(M);function E(o,r){return o+r&4294967295}var d=E;function U(o,r,a,e,t){let s=t||d;return r=s(s(r,o),s(a,e)),r}function T(o,r,a,e){var s=(e||d)(o<<r|o>>>32-r,a);return s}function D(o,r,a,e,t,s,n){return r=U(o,r,e,s,n),T(r,t,a,n)}function B(o,r,a,e,t,s,n,i){return D(a&e|~a&t,r,a,s,n,i,o)}function F(o,r,a,e,t,s,n,i){return D(a&t|e&~t,r,a,s,n,i,o)}function A(o,r,a,e,t,s,n,i){return D(a^e^t,r,a,s,n,i,o)}function L(o,r,a,e,t,s,n,i){return D(e^(a|~t),r,a,s,n,i,o)}function $(o,r,a){typeof a>"u"&&(a=d);let e=o[0],t=o[1],s=o[2],n=o[3],i=B.bind(null,a);e=i(e,t,s,n,r[0],7,-680876936),n=i(n,e,t,s,r[1],12,-389564586),s=i(s,n,e,t,r[2],17,606105819),t=i(t,s,n,e,r[3],22,-1044525330),e=i(e,t,s,n,r[4],7,-176418897),n=i(n,e,t,s,r[5],12,1200080426),s=i(s,n,e,t,r[6],17,-1473231341),t=i(t,s,n,e,r[7],22,-45705983),e=i(e,t,s,n,r[8],7,1770035416),n=i(n,e,t,s,r[9],12,-1958414417),s=i(s,n,e,t,r[10],17,-42063),t=i(t,s,n,e,r[11],22,-1990404162),e=i(e,t,s,n,r[12],7,1804603682),n=i(n,e,t,s,r[13],12,-40341101),s=i(s,n,e,t,r[14],17,-1502002290),t=i(t,s,n,e,r[15],22,1236535329);let u=F.bind(null,a);e=u(e,t,s,n,r[1],5,-165796510),n=u(n,e,t,s,r[6],9,-1069501632),s=u(s,n,e,t,r[11],14,643717713),t=u(t,s,n,e,r[0],20,-373897302),e=u(e,t,s,n,r[5],5,-701558691),n=u(n,e,t,s,r[10],9,38016083),s=u(s,n,e,t,r[15],14,-660478335),t=u(t,s,n,e,r[4],20,-405537848),e=u(e,t,s,n,r[9],5,568446438),n=u(n,e,t,s,r[14],9,-1019803690),s=u(s,n,e,t,r[3],14,-187363961),t=u(t,s,n,e,r[8],20,1163531501),e=u(e,t,s,n,r[13],5,-1444681467),n=u(n,e,t,s,r[2],9,-51403784),s=u(s,n,e,t,r[7],14,1735328473),t=u(t,s,n,e,r[12],20,-1926607734);let f=A.bind(null,a);e=f(e,t,s,n,r[5],4,-378558),n=f(n,e,t,s,r[8],11,-2022574463),s=f(s,n,e,t,r[11],16,1839030562),t=f(t,s,n,e,r[14],23,-35309556),e=f(e,t,s,n,r[1],4,-1530992060),n=f(n,e,t,s,r[4],11,1272893353),s=f(s,n,e,t,r[7],16,-155497632),t=f(t,s,n,e,r[10],23,-1094730640),e=f(e,t,s,n,r[13],4,681279174),n=f(n,e,t,s,r[0],11,-358537222),s=f(s,n,e,t,r[3],16,-722521979),t=f(t,s,n,e,r[6],23,76029189),e=f(e,t,s,n,r[9],4,-640364487),n=f(n,e,t,s,r[12],11,-421815835),s=f(s,n,e,t,r[15],16,530742520),t=f(t,s,n,e,r[2],23,-995338651);let m=L.bind(null,a);e=m(e,t,s,n,r[0],6,-198630844),n=m(n,e,t,s,r[7],10,1126891415),s=m(s,n,e,t,r[14],15,-1416354905),t=m(t,s,n,e,r[5],21,-57434055),e=m(e,t,s,n,r[12],6,1700485571),n=m(n,e,t,s,r[3],10,-1894986606),s=m(s,n,e,t,r[10],15,-1051523),t=m(t,s,n,e,r[1],21,-2054922799),e=m(e,t,s,n,r[8],6,1873313359),n=m(n,e,t,s,r[15],10,-30611744),s=m(s,n,e,t,r[6],15,-1560198380),t=m(t,s,n,e,r[13],21,1309151649),e=m(e,t,s,n,r[4],6,-145523070),n=m(n,e,t,s,r[11],10,-1120210379),s=m(s,n,e,t,r[2],15,718787259),t=m(t,s,n,e,r[9],21,-343485551),o[0]=a(e,o[0]),o[1]=a(t,o[1]),o[2]=a(s,o[2]),o[3]=a(n,o[3]);}var b=$;var j="0123456789abcdef".split(""),S=j;function z(o){let r="";for(let a=0;a<4;a++)r+=S[o>>a*8+4&15]+S[o>>a*8&15];return r}function H(o){let r=o.length,a=new Array(r);for(let e=0;e<r;e++)a[e]=z(o[e]);return a.join("")}var g=H;var R=class o extends stream.Transform{constructor(a){super({readableObjectMode:false,writableObjectMode:false});this.initialMD5State=[1732584193,-271733879,-1732584194,271733878];this.bufferCapacity=64;this.buffer=new Uint8Array(this.bufferCapacity);this.add32=a?.add32||d,this.state={state:[...this.initialMD5State],bytesProcessed:0,bufferLength:0,buffer:this.buffer};}_transform(a,e,t){try{let s=a,n=s.length;if(n===0){t();return}if(this.state.bufferLength>0){let f=this.state.bufferLength,m=64-f,l=Math.min(n,m);for(let c=0;c<l;c++)this.buffer[f+c]=s[c];if(this.state.bufferLength+=l,this.state.bufferLength===64&&this._processBufferBlock(),l===n){t();return}let h=n-l;for(let c=0;c<h;c++)s[c]=s[l+c];let y=Buffer.alloc(h);for(let c=0;c<h;c++)y[c]=s[c];s=y;}let i=Math.floor(s.length/64);for(let f=0;f<i;f++){let m=f*64,l=[];for(let h=0;h<16;h++){let y=m+h*4;l[h]=s[y]+(s[y+1]<<8)+(s[y+2]<<16)+(s[y+3]<<24);}b(this.state.state,l,this.add32),this.state.bytesProcessed+=64;}let u=s.length%64;if(u>0){this.buffer.length<u&&(this.buffer=new Uint8Array(u),this.state.buffer=this.buffer);for(let f=0;f<u;f++)this.buffer[f]=s[i*64+f];this.state.bufferLength=u;}t();}catch(s){t(s);}}_processBufferBlock(){let a=this.state.buffer,e=[];for(let t=0;t<16;t++){let s=t*4;e[t]=a[s]+(a[s+1]<<8)+(a[s+2]<<16)+(a[s+3]<<24);}b(this.state.state,e,this.add32),this.state.bytesProcessed+=64,this.state.bufferLength=0;}_flush(a){try{let{state:e,bufferLength:t,buffer:s}=this.state,n=new Array(16).fill(0);for(let u=0;u<t;u++)n[u>>2]|=(s[u]&255)<<(u%4<<3);if(n[t>>2]|=128<<(t%4<<3),t>55){b(e,n,this.add32);for(let u=0;u<16;u++)n[u]=0;}n[14]=(this.state.bytesProcessed+t)*8,n[15]=0,b(e,n,this.add32);let i=g(e);this.emit("md5",{digest:i,bytesProcessed:this.state.bytesProcessed+t}),a();}catch(e){a(e);}}getCurrentState(){return {state:[...this.state.state],bytesProcessed:this.state.bytesProcessed+this.state.bufferLength}}getBytesProcessed(){return this.state.bytesProcessed+this.state.bufferLength}reset(){this.state={state:[...this.initialMD5State],bytesProcessed:0,bufferLength:0,buffer:this.buffer},this.buffer=new Uint8Array(this.bufferCapacity),this.state.buffer=this.buffer,this.state.bufferLength=0;}static fromStream(a,e){let t=new o(e),s=x.call(t,a);return {stream:t,result:s}}};function w(o){return new R(o)}async function x(o){return new Promise((r,a)=>{let e=[];o.pipe(this).on("md5",t=>{e.push(t);}).on("error",a).on("finish",()=>{r(e[0]);});})}function W(o,r){let a=new R(r),e=x.call(a,o);return {stream:a,result:e}}function I(o,r){let a=o.length,e=[1732584193,-271733879,-1732584194,271733878],t;for(t=64;t<=a;t+=64){let i=q(o,t-64);b(e,i,r);}let s=a-t+64,n=new Array(16).fill(0);for(let i=0;i<s;i++)n[i>>2]|=(o[a-s+i]&255)<<(i%4<<3);if(n[s>>2]|=128<<(s%4<<3),s>55){b(e,n,r);for(let i=0;i<16;i++)n[i]=0;}return n[14]=a*8,n[15]=0,b(e,n,r),e}function q(o,r){let a=[];for(let e=0;e<64;e+=4)a[e>>2]=(o[r+e]||0)+((o[r+e+1]||0)<<8)+((o[r+e+2]||0)<<16)+((o[r+e+3]||0)<<24);return a}var O=I;function C(o){return g(O(o,d))}async function P(o,r={}){if(typeof o!="string"||o.trim()==="")throw new Error("Invalid file path: must be a non-empty string");if(!M__default.default.existsSync(o))throw new Error(`File not found: ${o}`);let a;try{a=M__default.default.statSync(o);}catch(t){throw new Error(`Failed to access file ${o}: ${t.message}`)}if(!a.isFile())throw new Error(`Path is not a file: ${o}`);let e=M__default.default.createReadStream(o,{highWaterMark:r.chunkSize||64*1024});try{return await v(e,{onProgress:r.onProgress,totalSize:a.size})}finally{e.destroy();}}async function v(o,r={}){if(!o||typeof o.on!="function")throw new Error("Invalid readable stream: stream must have event listener support");let a=w(),e=0;return r.onProgress&&o.on("data",t=>{e+=t.length,r.onProgress?.(e);}),o.on("error",t=>{a.destroy(t);}),o.on("end",()=>{a.end();}),new Promise((t,s)=>{a.on("md5",n=>{t(n);}).on("error",n=>{s(n);}),o.pipe(a);})}async function G(o,r={}){return (await P(o,r)).digest}async function J(o,r={}){return (await v(o,r)).digest}async function K(o,r,a={}){return (await P(o,a)).digest.toLowerCase()===r.toLowerCase()}function N(o){if(typeof o!="string"||o.trim()==="")throw new Error("Invalid file path: must be a non-empty string");if(!M__default.default.existsSync(o))throw new Error(`File not found: ${o}`);let r;try{r=M__default.default.statSync(o);}catch(e){throw new Error(`Failed to access file ${o}: ${e.message}`)}if(!r.isFile())throw new Error(`Path is not a file: ${o}`);let a;try{a=M__default.default.readFileSync(o);}catch(e){throw new Error(`Failed to read file ${o}: ${e.message}`)}return C(a)}function Q(o,r){let a=0;return e=>{if(o>0){let t=Math.min(100,e/o*100);Math.floor(t)!==Math.floor(a)&&(r(t),a=t);}}}var V=[1732584193,-271733879,-1732584194,271733878],p=class o{constructor(r,a={}){this.result=null;this.resultResolver=null;this.consumed=false;this.bufferCapacity=64;this.buffer=new Uint8Array(this.bufferCapacity);this.sourceStream=r,this.state={state:[...V],bytesProcessed:0,bufferLength:0,buffer:this.buffer},this.add32=a.add32||d,this.resultPromise=new Promise(e=>{this.resultResolver=e;});}getReader(){if(this.consumed)throw new Error("Cannot get reader from MD5ReadableStream: stream has already been consumed");this.consumed=true;let{readable:r,writable:a}=new TransformStream({transform:async(e,t)=>{await this.processChunk(e),t.enqueue(e);},flush:async e=>{this.finalize(),this.resultResolver&&this.resultResolver(this.result);}});return this.sourceStream.pipeTo(a).catch(e=>{console.error("Error piping stream:",e),this.resultResolver&&this.resultResolver({digest:"",bytesProcessed:this.state.bytesProcessed});}),r.getReader()}async processChunk(r){let a;r instanceof Blob?a=new Uint8Array(await r.arrayBuffer()):r instanceof ArrayBuffer?a=new Uint8Array(r):a=r;let e=a.length;if(e===0)return;if(this.state.bufferLength>0){let n=this.state.bufferLength,i=64-n,u=Math.min(e,i);for(let l=0;l<u;l++)this.buffer[n+l]=a[l];if(this.state.bufferLength+=u,this.state.bufferLength===64&&this._processBufferBlock(),u===e)return;let f=e-u,m=new Uint8Array(f);for(let l=0;l<f;l++)m[l]=a[u+l];a=m;}let t=Math.floor(a.length/64);for(let n=0;n<t;n++){let i=n*64,u=[];for(let f=0;f<16;f++){let m=i+f*4;u[f]=a[m]+(a[m+1]<<8)+(a[m+2]<<16)+(a[m+3]<<24);}b(this.state.state,u,this.add32),this.state.bytesProcessed+=64;}let s=a.length%64;if(s>0){this.buffer.length<s&&(this.buffer=new Uint8Array(s),this.state.buffer=this.buffer);for(let n=0;n<s;n++)this.buffer[n]=a[t+n];this.state.bufferLength=s;}}_processBufferBlock(){let r=this.state.buffer,a=[];for(let e=0;e<16;e++){let t=e*4;a[e]=r[t]+(r[t+1]<<8)+(r[t+2]<<16)+(r[t+3]<<24);}b(this.state.state,a,this.add32),this.state.bytesProcessed+=64,this.state.bufferLength=0;}finalize(){let{state:r,bufferLength:a,buffer:e}=this.state,t=new Array(16).fill(0);for(let n=0;n<a;n++)t[n>>2]|=(e[n]&255)<<(n%4<<3);if(t[a>>2]|=128<<(a%4<<3),a>55){b(r,t,this.add32);for(let n=0;n<16;n++)t[n]=0;}t[14]=(this.state.bytesProcessed+a)*8,t[15]=0,b(r,t,this.add32);let s=g(r);this.result={digest:s,bytesProcessed:this.state.bytesProcessed+a};}getResult(){return this.resultPromise}getCurrentState(){return {state:[...this.state.state],bytesProcessed:this.state.bytesProcessed+this.state.bufferLength}}getBytesProcessed(){return this.state.bytesProcessed+this.state.bufferLength}static hash(r,a){let e=new o(r,a),t=e.getReader();return new Promise((s,n)=>{let i=0;t.read().then(function u({done:f,value:m}){if(f){s(e.getResult());return}i+=m.length,t.read().then(u);}).catch(n);})}static hashFile(r,a){let e=r.stream();return o.hash(e,a)}static hashBlob(r,a){return new Promise((e,t)=>{let s=new FileReader;s.onload=n=>{try{let i=n.target?.result,u=new ReadableStream({start(f){f.enqueue(new Uint8Array(i)),f.close();}});e(o.hash(u,a));}catch(i){t(i);}},s.onerror=()=>t(s.error),s.readAsArrayBuffer(r);})}};function X(o,r){return new p(o,r)}async function Y(o,r){let a=o.getReader(),e=new p(o,r),t=0;for(;;){let{done:s,value:n}=await a.read();if(s)break;n&&(t+=n.length);}return e.getResult()}async function Z(o,r){return p.hashFile(o,r)}async function k(o,r){return p.hashBlob(o,r)}async function ee(o,r){let a=o.getReader(),e=new p(o,r),t=0;for(;;){let{done:s,value:n}=await a.read();if(s)break;n&&(t+=n.length);}return e.getResult()}exports.MD5ReadableStream=p;exports.MD5Stream=R;exports.consumeWithMD5=ee;exports.createMD5ReadableStream=X;exports.createMD5Stream=w;exports.createProgressTracker=Q;exports.fromStream=W;exports.hashBlob=k;exports.hashFile=P;exports.hashFileDigest=G;exports.hashFileStream=v;exports.hashFileStreamDigest=J;exports.hashFileSync=N;exports.hashFileWHATWG=Z;exports.hashReadableStream=Y;exports.pipeThroughMD5=x;exports.verifyFile=K;//# sourceMappingURL=index.cjs.map
2
- //# sourceMappingURL=index.cjs.map
1
+ 'use strict';var stream=require('stream'),M=require('fs');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var M__default=/*#__PURE__*/_interopDefault(M);function E(o,r){return o+r&4294967295}var d=E;function U(o,r,a,e,t){let s=t||d;return r=s(s(r,o),s(a,e)),r}function T(o,r,a,e){var s=(e||d)(o<<r|o>>>32-r,a);return s}function D(o,r,a,e,t,s,n){return r=U(o,r,e,s,n),T(r,t,a,n)}function B(o,r,a,e,t,s,n,i){return D(a&e|~a&t,r,a,s,n,i,o)}function F(o,r,a,e,t,s,n,i){return D(a&t|e&~t,r,a,s,n,i,o)}function A(o,r,a,e,t,s,n,i){return D(a^e^t,r,a,s,n,i,o)}function L(o,r,a,e,t,s,n,i){return D(e^(a|~t),r,a,s,n,i,o)}function $(o,r,a){typeof a>"u"&&(a=d);let e=o[0],t=o[1],s=o[2],n=o[3],i=B.bind(null,a);e=i(e,t,s,n,r[0],7,-680876936),n=i(n,e,t,s,r[1],12,-389564586),s=i(s,n,e,t,r[2],17,606105819),t=i(t,s,n,e,r[3],22,-1044525330),e=i(e,t,s,n,r[4],7,-176418897),n=i(n,e,t,s,r[5],12,1200080426),s=i(s,n,e,t,r[6],17,-1473231341),t=i(t,s,n,e,r[7],22,-45705983),e=i(e,t,s,n,r[8],7,1770035416),n=i(n,e,t,s,r[9],12,-1958414417),s=i(s,n,e,t,r[10],17,-42063),t=i(t,s,n,e,r[11],22,-1990404162),e=i(e,t,s,n,r[12],7,1804603682),n=i(n,e,t,s,r[13],12,-40341101),s=i(s,n,e,t,r[14],17,-1502002290),t=i(t,s,n,e,r[15],22,1236535329);let u=F.bind(null,a);e=u(e,t,s,n,r[1],5,-165796510),n=u(n,e,t,s,r[6],9,-1069501632),s=u(s,n,e,t,r[11],14,643717713),t=u(t,s,n,e,r[0],20,-373897302),e=u(e,t,s,n,r[5],5,-701558691),n=u(n,e,t,s,r[10],9,38016083),s=u(s,n,e,t,r[15],14,-660478335),t=u(t,s,n,e,r[4],20,-405537848),e=u(e,t,s,n,r[9],5,568446438),n=u(n,e,t,s,r[14],9,-1019803690),s=u(s,n,e,t,r[3],14,-187363961),t=u(t,s,n,e,r[8],20,1163531501),e=u(e,t,s,n,r[13],5,-1444681467),n=u(n,e,t,s,r[2],9,-51403784),s=u(s,n,e,t,r[7],14,1735328473),t=u(t,s,n,e,r[12],20,-1926607734);let f=A.bind(null,a);e=f(e,t,s,n,r[5],4,-378558),n=f(n,e,t,s,r[8],11,-2022574463),s=f(s,n,e,t,r[11],16,1839030562),t=f(t,s,n,e,r[14],23,-35309556),e=f(e,t,s,n,r[1],4,-1530992060),n=f(n,e,t,s,r[4],11,1272893353),s=f(s,n,e,t,r[7],16,-155497632),t=f(t,s,n,e,r[10],23,-1094730640),e=f(e,t,s,n,r[13],4,681279174),n=f(n,e,t,s,r[0],11,-358537222),s=f(s,n,e,t,r[3],16,-722521979),t=f(t,s,n,e,r[6],23,76029189),e=f(e,t,s,n,r[9],4,-640364487),n=f(n,e,t,s,r[12],11,-421815835),s=f(s,n,e,t,r[15],16,530742520),t=f(t,s,n,e,r[2],23,-995338651);let m=L.bind(null,a);e=m(e,t,s,n,r[0],6,-198630844),n=m(n,e,t,s,r[7],10,1126891415),s=m(s,n,e,t,r[14],15,-1416354905),t=m(t,s,n,e,r[5],21,-57434055),e=m(e,t,s,n,r[12],6,1700485571),n=m(n,e,t,s,r[3],10,-1894986606),s=m(s,n,e,t,r[10],15,-1051523),t=m(t,s,n,e,r[1],21,-2054922799),e=m(e,t,s,n,r[8],6,1873313359),n=m(n,e,t,s,r[15],10,-30611744),s=m(s,n,e,t,r[6],15,-1560198380),t=m(t,s,n,e,r[13],21,1309151649),e=m(e,t,s,n,r[4],6,-145523070),n=m(n,e,t,s,r[11],10,-1120210379),s=m(s,n,e,t,r[2],15,718787259),t=m(t,s,n,e,r[9],21,-343485551),o[0]=a(e,o[0]),o[1]=a(t,o[1]),o[2]=a(s,o[2]),o[3]=a(n,o[3]);}var b=$;var j="0123456789abcdef".split(""),S=j;function z(o){let r="";for(let a=0;a<4;a++)r+=S[o>>a*8+4&15]+S[o>>a*8&15];return r}function H(o){let r=o.length,a=new Array(r);for(let e=0;e<r;e++)a[e]=z(o[e]);return a.join("")}var g=H;var R=class o extends stream.Transform{constructor(a){super({readableObjectMode:false,writableObjectMode:false});this.initialMD5State=[1732584193,-271733879,-1732584194,271733878];this.bufferCapacity=64;this.buffer=new Uint8Array(this.bufferCapacity);this.add32=a?.add32||d,this.state={state:[...this.initialMD5State],bytesProcessed:0,bufferLength:0,buffer:this.buffer};}_transform(a,e,t){try{let s=a,n=s.length;if(n===0){t();return}if(this.state.bufferLength>0){let f=this.state.bufferLength,m=64-f,l=Math.min(n,m);for(let c=0;c<l;c++)this.buffer[f+c]=s[c];if(this.state.bufferLength+=l,this.state.bufferLength===64&&this._processBufferBlock(),l===n){t();return}let h=n-l;for(let c=0;c<h;c++)s[c]=s[l+c];let y=Buffer.alloc(h);for(let c=0;c<h;c++)y[c]=s[c];s=y;}let i=Math.floor(s.length/64);for(let f=0;f<i;f++){let m=f*64,l=[];for(let h=0;h<16;h++){let y=m+h*4;l[h]=s[y]+(s[y+1]<<8)+(s[y+2]<<16)+(s[y+3]<<24);}b(this.state.state,l,this.add32),this.state.bytesProcessed+=64;}let u=s.length%64;if(u>0){this.buffer.length<u&&(this.buffer=new Uint8Array(u),this.state.buffer=this.buffer);for(let f=0;f<u;f++)this.buffer[f]=s[i*64+f];this.state.bufferLength=u;}t();}catch(s){t(s);}}_processBufferBlock(){let a=this.state.buffer,e=[];for(let t=0;t<16;t++){let s=t*4;e[t]=a[s]+(a[s+1]<<8)+(a[s+2]<<16)+(a[s+3]<<24);}b(this.state.state,e,this.add32),this.state.bytesProcessed+=64,this.state.bufferLength=0;}_flush(a){try{let{state:e,bufferLength:t,buffer:s}=this.state,n=new Array(16).fill(0);for(let u=0;u<t;u++)n[u>>2]|=(s[u]&255)<<(u%4<<3);if(n[t>>2]|=128<<(t%4<<3),t>55){b(e,n,this.add32);for(let u=0;u<16;u++)n[u]=0;}n[14]=(this.state.bytesProcessed+t)*8,n[15]=0,b(e,n,this.add32);let i=g(e);this.emit("md5",{digest:i,bytesProcessed:this.state.bytesProcessed+t}),a();}catch(e){a(e);}}getCurrentState(){return {state:[...this.state.state],bytesProcessed:this.state.bytesProcessed+this.state.bufferLength}}getBytesProcessed(){return this.state.bytesProcessed+this.state.bufferLength}reset(){this.state={state:[...this.initialMD5State],bytesProcessed:0,bufferLength:0,buffer:this.buffer},this.buffer=new Uint8Array(this.bufferCapacity),this.state.buffer=this.buffer,this.state.bufferLength=0;}static fromStream(a,e){let t=new o(e),s=x.call(t,a);return {stream:t,result:s}}};function w(o){return new R(o)}async function x(o){return new Promise((r,a)=>{let e=[];o.pipe(this).on("md5",t=>{e.push(t);}).on("error",a).on("finish",()=>{r(e[0]);});})}function W(o,r){let a=new R(r),e=x.call(a,o);return {stream:a,result:e}}function I(o,r){let a=o.length,e=[1732584193,-271733879,-1732584194,271733878],t;for(t=64;t<=a;t+=64){let i=q(o,t-64);b(e,i,r);}let s=a-t+64,n=new Array(16).fill(0);for(let i=0;i<s;i++)n[i>>2]|=(o[a-s+i]&255)<<(i%4<<3);if(n[s>>2]|=128<<(s%4<<3),s>55){b(e,n,r);for(let i=0;i<16;i++)n[i]=0;}return n[14]=a*8,n[15]=0,b(e,n,r),e}function q(o,r){let a=[];for(let e=0;e<64;e+=4)a[e>>2]=(o[r+e]||0)+((o[r+e+1]||0)<<8)+((o[r+e+2]||0)<<16)+((o[r+e+3]||0)<<24);return a}var O=I;function C(o){return g(O(o,d))}async function P(o,r={}){if(typeof o!="string"||o.trim()==="")throw new Error("Invalid file path: must be a non-empty string");if(!M__default.default.existsSync(o))throw new Error(`File not found: ${o}`);let a;try{a=M__default.default.statSync(o);}catch(t){throw new Error(`Failed to access file ${o}: ${t.message}`)}if(!a.isFile())throw new Error(`Path is not a file: ${o}`);let e=M__default.default.createReadStream(o,{highWaterMark:r.chunkSize||64*1024});try{return await v(e,{onProgress:r.onProgress,totalSize:a.size})}finally{e.destroy();}}async function v(o,r={}){if(!o||typeof o.on!="function")throw new Error("Invalid readable stream: stream must have event listener support");let a=w(),e=0;return r.onProgress&&o.on("data",t=>{e+=t.length,r.onProgress?.(e);}),o.on("error",t=>{a.destroy(t);}),o.on("end",()=>{a.end();}),new Promise((t,s)=>{a.on("md5",n=>{t(n);}).on("error",n=>{s(n);}),o.pipe(a);})}async function G(o,r={}){return (await P(o,r)).digest}async function J(o,r={}){return (await v(o,r)).digest}async function K(o,r,a={}){return (await P(o,a)).digest.toLowerCase()===r.toLowerCase()}function N(o){if(typeof o!="string"||o.trim()==="")throw new Error("Invalid file path: must be a non-empty string");if(!M__default.default.existsSync(o))throw new Error(`File not found: ${o}`);let r;try{r=M__default.default.statSync(o);}catch(e){throw new Error(`Failed to access file ${o}: ${e.message}`)}if(!r.isFile())throw new Error(`Path is not a file: ${o}`);let a;try{a=M__default.default.readFileSync(o);}catch(e){throw new Error(`Failed to read file ${o}: ${e.message}`)}return C(a)}function Q(o,r){let a=0;return e=>{if(o>0){let t=Math.min(100,e/o*100);Math.floor(t)!==Math.floor(a)&&(r(t),a=t);}}}var V=[1732584193,-271733879,-1732584194,271733878],p=class o{constructor(r,a={}){this.result=null;this.resultResolver=null;this.consumed=false;this.bufferCapacity=64;this.buffer=new Uint8Array(this.bufferCapacity);this.sourceStream=r,this.state={state:[...V],bytesProcessed:0,bufferLength:0,buffer:this.buffer},this.add32=a.add32||d,this.resultPromise=new Promise(e=>{this.resultResolver=e;});}getReader(){if(this.consumed)throw new Error("Cannot get reader from MD5ReadableStream: stream has already been consumed");this.consumed=true;let{readable:r,writable:a}=new TransformStream({transform:async(e,t)=>{await this.processChunk(e),t.enqueue(e);},flush:async e=>{this.finalize(),this.resultResolver&&this.resultResolver(this.result);}});return this.sourceStream.pipeTo(a).catch(e=>{console.error("Error piping stream:",e),this.resultResolver&&this.resultResolver({digest:"",bytesProcessed:this.state.bytesProcessed});}),r.getReader()}async processChunk(r){let a;r instanceof Blob?a=new Uint8Array(await r.arrayBuffer()):r instanceof ArrayBuffer?a=new Uint8Array(r):a=r;let e=a.length;if(e===0)return;if(this.state.bufferLength>0){let n=this.state.bufferLength,i=64-n,u=Math.min(e,i);for(let l=0;l<u;l++)this.buffer[n+l]=a[l];if(this.state.bufferLength+=u,this.state.bufferLength===64&&this._processBufferBlock(),u===e)return;let f=e-u,m=new Uint8Array(f);for(let l=0;l<f;l++)m[l]=a[u+l];a=m;}let t=Math.floor(a.length/64);for(let n=0;n<t;n++){let i=n*64,u=[];for(let f=0;f<16;f++){let m=i+f*4;u[f]=a[m]+(a[m+1]<<8)+(a[m+2]<<16)+(a[m+3]<<24);}b(this.state.state,u,this.add32),this.state.bytesProcessed+=64;}let s=a.length%64;if(s>0){this.buffer.length<s&&(this.buffer=new Uint8Array(s),this.state.buffer=this.buffer);for(let n=0;n<s;n++)this.buffer[n]=a[t+n];this.state.bufferLength=s;}}_processBufferBlock(){let r=this.state.buffer,a=[];for(let e=0;e<16;e++){let t=e*4;a[e]=r[t]+(r[t+1]<<8)+(r[t+2]<<16)+(r[t+3]<<24);}b(this.state.state,a,this.add32),this.state.bytesProcessed+=64,this.state.bufferLength=0;}finalize(){let{state:r,bufferLength:a,buffer:e}=this.state,t=new Array(16).fill(0);for(let n=0;n<a;n++)t[n>>2]|=(e[n]&255)<<(n%4<<3);if(t[a>>2]|=128<<(a%4<<3),a>55){b(r,t,this.add32);for(let n=0;n<16;n++)t[n]=0;}t[14]=(this.state.bytesProcessed+a)*8,t[15]=0,b(r,t,this.add32);let s=g(r);this.result={digest:s,bytesProcessed:this.state.bytesProcessed+a};}getResult(){return this.resultPromise}getCurrentState(){return {state:[...this.state.state],bytesProcessed:this.state.bytesProcessed+this.state.bufferLength}}getBytesProcessed(){return this.state.bytesProcessed+this.state.bufferLength}static hash(r,a){let e=new o(r,a),t=e.getReader();return new Promise((s,n)=>{let i=0;t.read().then(function u({done:f,value:m}){if(f){s(e.getResult());return}i+=m.length,t.read().then(u);}).catch(n);})}static hashFile(r,a){let e=r.stream();return o.hash(e,a)}static hashBlob(r,a){return new Promise((e,t)=>{let s=new FileReader;s.onload=n=>{try{let i=n.target?.result,u=new ReadableStream({start(f){f.enqueue(new Uint8Array(i)),f.close();}});e(o.hash(u,a));}catch(i){t(i);}},s.onerror=()=>t(s.error),s.readAsArrayBuffer(r);})}};function X(o,r){return new p(o,r)}async function Y(o,r){let a=o.getReader(),e=new p(o,r),t=0;for(;;){let{done:s,value:n}=await a.read();if(s)break;n&&(t+=n.length);}return e.getResult()}async function Z(o,r){return p.hashFile(o,r)}async function k(o,r){return p.hashBlob(o,r)}async function ee(o,r){let a=o.getReader(),e=new p(o,r),t=0;for(;;){let{done:s,value:n}=await a.read();if(s)break;n&&(t+=n.length);}return e.getResult()}exports.MD5ReadableStream=p;exports.MD5Stream=R;exports.consumeWithMD5=ee;exports.createMD5ReadableStream=X;exports.createMD5Stream=w;exports.createProgressTracker=Q;exports.fromStream=W;exports.hashBlob=k;exports.hashFile=P;exports.hashFileDigest=G;exports.hashFileStream=v;exports.hashFileStreamDigest=J;exports.hashFileSync=N;exports.hashFileWHATWG=Z;exports.hashReadableStream=Y;exports.pipeThroughMD5=x;exports.verifyFile=K;
@@ -1,2 +1 @@
1
- export{a as MD5ReadableStream,f as consumeWithMD5,b as createMD5ReadableStream,e as hashBlob,d as hashFileWHATWG,c as hashReadableStream}from'../../chunk-XB5BQIEX.js';export{g as createProgressTracker,a as hashFile,c as hashFileDigest,b as hashFileStream,d as hashFileStreamDigest,f as hashFileSync,e as verifyFile}from'../../chunk-H2K353LR.js';import'../../chunk-NWQ4N5RX.js';export{a as MD5Stream,b as createMD5Stream,d as fromStream,c as pipeThroughMD5}from'../../chunk-JKVD5LHZ.js';import'../../chunk-R4JB5MBR.js';import'../../chunk-2YXXFGBV.js';//# sourceMappingURL=index.js.map
2
- //# sourceMappingURL=index.js.map
1
+ export{a as MD5ReadableStream,f as consumeWithMD5,b as createMD5ReadableStream,e as hashBlob,d as hashFileWHATWG,c as hashReadableStream}from'../../chunk-BEGGPFEE.js';export{g as createProgressTracker,a as hashFile,c as hashFileDigest,b as hashFileStream,d as hashFileStreamDigest,f as hashFileSync,e as verifyFile}from'../../chunk-YDAOGTNB.js';import'../../chunk-Z4JB6DTM.js';export{a as MD5Stream,b as createMD5Stream,d as fromStream,c as pipeThroughMD5}from'../../chunk-MIU3X4SB.js';import'../../chunk-DFR4GYL3.js';import'../../chunk-I7AUKTXE.js';
@@ -1,2 +1 @@
1
- 'use strict';var stream=require('stream');function B(i,s){return i+s&4294967295}var l=B;function v(i,s,u,t,r){let e=r||l;return s=e(e(s,i),e(u,t)),s}function w(i,s,u,t){var e=(t||l)(i<<s|i>>>32-s,u);return e}function g(i,s,u,t,r,e,n){return s=v(i,s,t,e,n),w(s,r,u,n)}function D(i,s,u,t,r,e,n,f){return g(u&t|~u&r,s,u,e,n,f,i)}function x(i,s,u,t,r,e,n,f){return g(u&r|t&~r,s,u,e,n,f,i)}function P(i,s,u,t,r,e,n,f){return g(u^t^r,s,u,e,n,f,i)}function S(i,s,u,t,r,e,n,f){return g(t^(u|~r),s,u,e,n,f,i)}function F(i,s,u){typeof u>"u"&&(u=l);let t=i[0],r=i[1],e=i[2],n=i[3],f=D.bind(null,u);t=f(t,r,e,n,s[0],7,-680876936),n=f(n,t,r,e,s[1],12,-389564586),e=f(e,n,t,r,s[2],17,606105819),r=f(r,e,n,t,s[3],22,-1044525330),t=f(t,r,e,n,s[4],7,-176418897),n=f(n,t,r,e,s[5],12,1200080426),e=f(e,n,t,r,s[6],17,-1473231341),r=f(r,e,n,t,s[7],22,-45705983),t=f(t,r,e,n,s[8],7,1770035416),n=f(n,t,r,e,s[9],12,-1958414417),e=f(e,n,t,r,s[10],17,-42063),r=f(r,e,n,t,s[11],22,-1990404162),t=f(t,r,e,n,s[12],7,1804603682),n=f(n,t,r,e,s[13],12,-40341101),e=f(e,n,t,r,s[14],17,-1502002290),r=f(r,e,n,t,s[15],22,1236535329);let o=x.bind(null,u);t=o(t,r,e,n,s[1],5,-165796510),n=o(n,t,r,e,s[6],9,-1069501632),e=o(e,n,t,r,s[11],14,643717713),r=o(r,e,n,t,s[0],20,-373897302),t=o(t,r,e,n,s[5],5,-701558691),n=o(n,t,r,e,s[10],9,38016083),e=o(e,n,t,r,s[15],14,-660478335),r=o(r,e,n,t,s[4],20,-405537848),t=o(t,r,e,n,s[9],5,568446438),n=o(n,t,r,e,s[14],9,-1019803690),e=o(e,n,t,r,s[3],14,-187363961),r=o(r,e,n,t,s[8],20,1163531501),t=o(t,r,e,n,s[13],5,-1444681467),n=o(n,t,r,e,s[2],9,-51403784),e=o(e,n,t,r,s[7],14,1735328473),r=o(r,e,n,t,s[12],20,-1926607734);let a=P.bind(null,u);t=a(t,r,e,n,s[5],4,-378558),n=a(n,t,r,e,s[8],11,-2022574463),e=a(e,n,t,r,s[11],16,1839030562),r=a(r,e,n,t,s[14],23,-35309556),t=a(t,r,e,n,s[1],4,-1530992060),n=a(n,t,r,e,s[4],11,1272893353),e=a(e,n,t,r,s[7],16,-155497632),r=a(r,e,n,t,s[10],23,-1094730640),t=a(t,r,e,n,s[13],4,681279174),n=a(n,t,r,e,s[0],11,-358537222),e=a(e,n,t,r,s[3],16,-722521979),r=a(r,e,n,t,s[6],23,76029189),t=a(t,r,e,n,s[9],4,-640364487),n=a(n,t,r,e,s[12],11,-421815835),e=a(e,n,t,r,s[15],16,530742520),r=a(r,e,n,t,s[2],23,-995338651);let b=S.bind(null,u);t=b(t,r,e,n,s[0],6,-198630844),n=b(n,t,r,e,s[7],10,1126891415),e=b(e,n,t,r,s[14],15,-1416354905),r=b(r,e,n,t,s[5],21,-57434055),t=b(t,r,e,n,s[12],6,1700485571),n=b(n,t,r,e,s[3],10,-1894986606),e=b(e,n,t,r,s[10],15,-1051523),r=b(r,e,n,t,s[1],21,-2054922799),t=b(t,r,e,n,s[8],6,1873313359),n=b(n,t,r,e,s[15],10,-30611744),e=b(e,n,t,r,s[6],15,-1560198380),r=b(r,e,n,t,s[13],21,1309151649),t=b(t,r,e,n,s[4],6,-145523070),n=b(n,t,r,e,s[11],10,-1120210379),e=b(e,n,t,r,s[2],15,718787259),r=b(r,e,n,t,s[9],21,-343485551),i[0]=u(t,i[0]),i[1]=u(r,i[1]),i[2]=u(e,i[2]),i[3]=u(n,i[3]);}var p=F;var R="0123456789abcdef".split(""),M=R;function C(i){let s="";for(let u=0;u<4;u++)s+=M[i>>u*8+4&15]+M[i>>u*8&15];return s}function O(i){let s=i.length,u=new Array(s);for(let t=0;t<s;t++)u[t]=C(i[t]);return u.join("")}var A=O;var y=class i extends stream.Transform{constructor(u){super({readableObjectMode:false,writableObjectMode:false});this.initialMD5State=[1732584193,-271733879,-1732584194,271733878];this.bufferCapacity=64;this.buffer=new Uint8Array(this.bufferCapacity);this.add32=u?.add32||l,this.state={state:[...this.initialMD5State],bytesProcessed:0,bufferLength:0,buffer:this.buffer};}_transform(u,t,r){try{let e=u,n=e.length;if(n===0){r();return}if(this.state.bufferLength>0){let a=this.state.bufferLength,b=64-a,c=Math.min(n,b);for(let m=0;m<c;m++)this.buffer[a+m]=e[m];if(this.state.bufferLength+=c,this.state.bufferLength===64&&this._processBufferBlock(),c===n){r();return}let d=n-c;for(let m=0;m<d;m++)e[m]=e[c+m];let h=Buffer.alloc(d);for(let m=0;m<d;m++)h[m]=e[m];e=h;}let f=Math.floor(e.length/64);for(let a=0;a<f;a++){let b=a*64,c=[];for(let d=0;d<16;d++){let h=b+d*4;c[d]=e[h]+(e[h+1]<<8)+(e[h+2]<<16)+(e[h+3]<<24);}p(this.state.state,c,this.add32),this.state.bytesProcessed+=64;}let o=e.length%64;if(o>0){this.buffer.length<o&&(this.buffer=new Uint8Array(o),this.state.buffer=this.buffer);for(let a=0;a<o;a++)this.buffer[a]=e[f*64+a];this.state.bufferLength=o;}r();}catch(e){r(e);}}_processBufferBlock(){let u=this.state.buffer,t=[];for(let r=0;r<16;r++){let e=r*4;t[r]=u[e]+(u[e+1]<<8)+(u[e+2]<<16)+(u[e+3]<<24);}p(this.state.state,t,this.add32),this.state.bytesProcessed+=64,this.state.bufferLength=0;}_flush(u){try{let{state:t,bufferLength:r,buffer:e}=this.state,n=new Array(16).fill(0);for(let o=0;o<r;o++)n[o>>2]|=(e[o]&255)<<(o%4<<3);if(n[r>>2]|=128<<(r%4<<3),r>55){p(t,n,this.add32);for(let o=0;o<16;o++)n[o]=0;}n[14]=(this.state.bytesProcessed+r)*8,n[15]=0,p(t,n,this.add32);let f=A(t);this.emit("md5",{digest:f,bytesProcessed:this.state.bytesProcessed+r}),u();}catch(t){u(t);}}getCurrentState(){return {state:[...this.state.state],bytesProcessed:this.state.bytesProcessed+this.state.bufferLength}}getBytesProcessed(){return this.state.bytesProcessed+this.state.bufferLength}reset(){this.state={state:[...this.initialMD5State],bytesProcessed:0,bufferLength:0,buffer:this.buffer},this.buffer=new Uint8Array(this.bufferCapacity),this.state.buffer=this.buffer,this.state.bufferLength=0;}static fromStream(u,t){let r=new i(t),e=L.call(r,u);return {stream:r,result:e}}};function W(i){return new y(i)}async function L(i){return new Promise((s,u)=>{let t=[];i.pipe(this).on("md5",r=>{t.push(r);}).on("error",u).on("finish",()=>{s(t[0]);});})}function X(i,s){let u=new y(s),t=L.call(u,i);return {stream:u,result:t}}exports.MD5Stream=y;exports.createMD5Stream=W;exports.fromStream=X;exports.pipeThroughMD5=L;//# sourceMappingURL=md5-stream.cjs.map
2
- //# sourceMappingURL=md5-stream.cjs.map
1
+ 'use strict';var stream=require('stream');function B(i,s){return i+s&4294967295}var l=B;function v(i,s,u,t,r){let e=r||l;return s=e(e(s,i),e(u,t)),s}function w(i,s,u,t){var e=(t||l)(i<<s|i>>>32-s,u);return e}function g(i,s,u,t,r,e,n){return s=v(i,s,t,e,n),w(s,r,u,n)}function D(i,s,u,t,r,e,n,f){return g(u&t|~u&r,s,u,e,n,f,i)}function x(i,s,u,t,r,e,n,f){return g(u&r|t&~r,s,u,e,n,f,i)}function P(i,s,u,t,r,e,n,f){return g(u^t^r,s,u,e,n,f,i)}function S(i,s,u,t,r,e,n,f){return g(t^(u|~r),s,u,e,n,f,i)}function F(i,s,u){typeof u>"u"&&(u=l);let t=i[0],r=i[1],e=i[2],n=i[3],f=D.bind(null,u);t=f(t,r,e,n,s[0],7,-680876936),n=f(n,t,r,e,s[1],12,-389564586),e=f(e,n,t,r,s[2],17,606105819),r=f(r,e,n,t,s[3],22,-1044525330),t=f(t,r,e,n,s[4],7,-176418897),n=f(n,t,r,e,s[5],12,1200080426),e=f(e,n,t,r,s[6],17,-1473231341),r=f(r,e,n,t,s[7],22,-45705983),t=f(t,r,e,n,s[8],7,1770035416),n=f(n,t,r,e,s[9],12,-1958414417),e=f(e,n,t,r,s[10],17,-42063),r=f(r,e,n,t,s[11],22,-1990404162),t=f(t,r,e,n,s[12],7,1804603682),n=f(n,t,r,e,s[13],12,-40341101),e=f(e,n,t,r,s[14],17,-1502002290),r=f(r,e,n,t,s[15],22,1236535329);let o=x.bind(null,u);t=o(t,r,e,n,s[1],5,-165796510),n=o(n,t,r,e,s[6],9,-1069501632),e=o(e,n,t,r,s[11],14,643717713),r=o(r,e,n,t,s[0],20,-373897302),t=o(t,r,e,n,s[5],5,-701558691),n=o(n,t,r,e,s[10],9,38016083),e=o(e,n,t,r,s[15],14,-660478335),r=o(r,e,n,t,s[4],20,-405537848),t=o(t,r,e,n,s[9],5,568446438),n=o(n,t,r,e,s[14],9,-1019803690),e=o(e,n,t,r,s[3],14,-187363961),r=o(r,e,n,t,s[8],20,1163531501),t=o(t,r,e,n,s[13],5,-1444681467),n=o(n,t,r,e,s[2],9,-51403784),e=o(e,n,t,r,s[7],14,1735328473),r=o(r,e,n,t,s[12],20,-1926607734);let a=P.bind(null,u);t=a(t,r,e,n,s[5],4,-378558),n=a(n,t,r,e,s[8],11,-2022574463),e=a(e,n,t,r,s[11],16,1839030562),r=a(r,e,n,t,s[14],23,-35309556),t=a(t,r,e,n,s[1],4,-1530992060),n=a(n,t,r,e,s[4],11,1272893353),e=a(e,n,t,r,s[7],16,-155497632),r=a(r,e,n,t,s[10],23,-1094730640),t=a(t,r,e,n,s[13],4,681279174),n=a(n,t,r,e,s[0],11,-358537222),e=a(e,n,t,r,s[3],16,-722521979),r=a(r,e,n,t,s[6],23,76029189),t=a(t,r,e,n,s[9],4,-640364487),n=a(n,t,r,e,s[12],11,-421815835),e=a(e,n,t,r,s[15],16,530742520),r=a(r,e,n,t,s[2],23,-995338651);let b=S.bind(null,u);t=b(t,r,e,n,s[0],6,-198630844),n=b(n,t,r,e,s[7],10,1126891415),e=b(e,n,t,r,s[14],15,-1416354905),r=b(r,e,n,t,s[5],21,-57434055),t=b(t,r,e,n,s[12],6,1700485571),n=b(n,t,r,e,s[3],10,-1894986606),e=b(e,n,t,r,s[10],15,-1051523),r=b(r,e,n,t,s[1],21,-2054922799),t=b(t,r,e,n,s[8],6,1873313359),n=b(n,t,r,e,s[15],10,-30611744),e=b(e,n,t,r,s[6],15,-1560198380),r=b(r,e,n,t,s[13],21,1309151649),t=b(t,r,e,n,s[4],6,-145523070),n=b(n,t,r,e,s[11],10,-1120210379),e=b(e,n,t,r,s[2],15,718787259),r=b(r,e,n,t,s[9],21,-343485551),i[0]=u(t,i[0]),i[1]=u(r,i[1]),i[2]=u(e,i[2]),i[3]=u(n,i[3]);}var p=F;var R="0123456789abcdef".split(""),M=R;function C(i){let s="";for(let u=0;u<4;u++)s+=M[i>>u*8+4&15]+M[i>>u*8&15];return s}function O(i){let s=i.length,u=new Array(s);for(let t=0;t<s;t++)u[t]=C(i[t]);return u.join("")}var A=O;var y=class i extends stream.Transform{constructor(u){super({readableObjectMode:false,writableObjectMode:false});this.initialMD5State=[1732584193,-271733879,-1732584194,271733878];this.bufferCapacity=64;this.buffer=new Uint8Array(this.bufferCapacity);this.add32=u?.add32||l,this.state={state:[...this.initialMD5State],bytesProcessed:0,bufferLength:0,buffer:this.buffer};}_transform(u,t,r){try{let e=u,n=e.length;if(n===0){r();return}if(this.state.bufferLength>0){let a=this.state.bufferLength,b=64-a,c=Math.min(n,b);for(let m=0;m<c;m++)this.buffer[a+m]=e[m];if(this.state.bufferLength+=c,this.state.bufferLength===64&&this._processBufferBlock(),c===n){r();return}let d=n-c;for(let m=0;m<d;m++)e[m]=e[c+m];let h=Buffer.alloc(d);for(let m=0;m<d;m++)h[m]=e[m];e=h;}let f=Math.floor(e.length/64);for(let a=0;a<f;a++){let b=a*64,c=[];for(let d=0;d<16;d++){let h=b+d*4;c[d]=e[h]+(e[h+1]<<8)+(e[h+2]<<16)+(e[h+3]<<24);}p(this.state.state,c,this.add32),this.state.bytesProcessed+=64;}let o=e.length%64;if(o>0){this.buffer.length<o&&(this.buffer=new Uint8Array(o),this.state.buffer=this.buffer);for(let a=0;a<o;a++)this.buffer[a]=e[f*64+a];this.state.bufferLength=o;}r();}catch(e){r(e);}}_processBufferBlock(){let u=this.state.buffer,t=[];for(let r=0;r<16;r++){let e=r*4;t[r]=u[e]+(u[e+1]<<8)+(u[e+2]<<16)+(u[e+3]<<24);}p(this.state.state,t,this.add32),this.state.bytesProcessed+=64,this.state.bufferLength=0;}_flush(u){try{let{state:t,bufferLength:r,buffer:e}=this.state,n=new Array(16).fill(0);for(let o=0;o<r;o++)n[o>>2]|=(e[o]&255)<<(o%4<<3);if(n[r>>2]|=128<<(r%4<<3),r>55){p(t,n,this.add32);for(let o=0;o<16;o++)n[o]=0;}n[14]=(this.state.bytesProcessed+r)*8,n[15]=0,p(t,n,this.add32);let f=A(t);this.emit("md5",{digest:f,bytesProcessed:this.state.bytesProcessed+r}),u();}catch(t){u(t);}}getCurrentState(){return {state:[...this.state.state],bytesProcessed:this.state.bytesProcessed+this.state.bufferLength}}getBytesProcessed(){return this.state.bytesProcessed+this.state.bufferLength}reset(){this.state={state:[...this.initialMD5State],bytesProcessed:0,bufferLength:0,buffer:this.buffer},this.buffer=new Uint8Array(this.bufferCapacity),this.state.buffer=this.buffer,this.state.bufferLength=0;}static fromStream(u,t){let r=new i(t),e=L.call(r,u);return {stream:r,result:e}}};function W(i){return new y(i)}async function L(i){return new Promise((s,u)=>{let t=[];i.pipe(this).on("md5",r=>{t.push(r);}).on("error",u).on("finish",()=>{s(t[0]);});})}function X(i,s){let u=new y(s),t=L.call(u,i);return {stream:u,result:t}}exports.MD5Stream=y;exports.createMD5Stream=W;exports.fromStream=X;exports.pipeThroughMD5=L;
@@ -1,2 +1 @@
1
- export{a as MD5Stream,b as createMD5Stream,d as fromStream,c as pipeThroughMD5}from'../chunk-JKVD5LHZ.js';import'../chunk-R4JB5MBR.js';import'../chunk-2YXXFGBV.js';//# sourceMappingURL=md5-stream.js.map
2
- //# sourceMappingURL=md5-stream.js.map
1
+ export{a as MD5Stream,b as createMD5Stream,d as fromStream,c as pipeThroughMD5}from'../chunk-MIU3X4SB.js';import'../chunk-DFR4GYL3.js';import'../chunk-I7AUKTXE.js';
@@ -1,2 +1 @@
1
- 'use strict';function P(i,t){return i+t&4294967295}var m=P;function S(i,t,a,e,n){let s=n||m;return t=s(s(t,i),s(a,e)),t}function w(i,t,a,e){var s=(e||m)(i<<t|i>>>32-t,a);return s}function h(i,t,a,e,n,s,r){return t=S(i,t,e,s,r),w(t,n,a,r)}function y(i,t,a,e,n,s,r,u){return h(a&e|~a&n,t,a,s,r,u,i)}function R(i,t,a,e,n,s,r,u){return h(a&n|e&~n,t,a,s,r,u,i)}function g(i,t,a,e,n,s,r,u){return h(a^e^n,t,a,s,r,u,i)}function D(i,t,a,e,n,s,r,u){return h(e^(a|~n),t,a,s,r,u,i)}function A(i,t,a){typeof a>"u"&&(a=m);let e=i[0],n=i[1],s=i[2],r=i[3],u=y.bind(null,a);e=u(e,n,s,r,t[0],7,-680876936),r=u(r,e,n,s,t[1],12,-389564586),s=u(s,r,e,n,t[2],17,606105819),n=u(n,s,r,e,t[3],22,-1044525330),e=u(e,n,s,r,t[4],7,-176418897),r=u(r,e,n,s,t[5],12,1200080426),s=u(s,r,e,n,t[6],17,-1473231341),n=u(n,s,r,e,t[7],22,-45705983),e=u(e,n,s,r,t[8],7,1770035416),r=u(r,e,n,s,t[9],12,-1958414417),s=u(s,r,e,n,t[10],17,-42063),n=u(n,s,r,e,t[11],22,-1990404162),e=u(e,n,s,r,t[12],7,1804603682),r=u(r,e,n,s,t[13],12,-40341101),s=u(s,r,e,n,t[14],17,-1502002290),n=u(n,s,r,e,t[15],22,1236535329);let o=R.bind(null,a);e=o(e,n,s,r,t[1],5,-165796510),r=o(r,e,n,s,t[6],9,-1069501632),s=o(s,r,e,n,t[11],14,643717713),n=o(n,s,r,e,t[0],20,-373897302),e=o(e,n,s,r,t[5],5,-701558691),r=o(r,e,n,s,t[10],9,38016083),s=o(s,r,e,n,t[15],14,-660478335),n=o(n,s,r,e,t[4],20,-405537848),e=o(e,n,s,r,t[9],5,568446438),r=o(r,e,n,s,t[14],9,-1019803690),s=o(s,r,e,n,t[3],14,-187363961),n=o(n,s,r,e,t[8],20,1163531501),e=o(e,n,s,r,t[13],5,-1444681467),r=o(r,e,n,s,t[2],9,-51403784),s=o(s,r,e,n,t[7],14,1735328473),n=o(n,s,r,e,t[12],20,-1926607734);let l=g.bind(null,a);e=l(e,n,s,r,t[5],4,-378558),r=l(r,e,n,s,t[8],11,-2022574463),s=l(s,r,e,n,t[11],16,1839030562),n=l(n,s,r,e,t[14],23,-35309556),e=l(e,n,s,r,t[1],4,-1530992060),r=l(r,e,n,s,t[4],11,1272893353),s=l(s,r,e,n,t[7],16,-155497632),n=l(n,s,r,e,t[10],23,-1094730640),e=l(e,n,s,r,t[13],4,681279174),r=l(r,e,n,s,t[0],11,-358537222),s=l(s,r,e,n,t[3],16,-722521979),n=l(n,s,r,e,t[6],23,76029189),e=l(e,n,s,r,t[9],4,-640364487),r=l(r,e,n,s,t[12],11,-421815835),s=l(s,r,e,n,t[15],16,530742520),n=l(n,s,r,e,t[2],23,-995338651);let b=D.bind(null,a);e=b(e,n,s,r,t[0],6,-198630844),r=b(r,e,n,s,t[7],10,1126891415),s=b(s,r,e,n,t[14],15,-1416354905),n=b(n,s,r,e,t[5],21,-57434055),e=b(e,n,s,r,t[12],6,1700485571),r=b(r,e,n,s,t[3],10,-1894986606),s=b(s,r,e,n,t[10],15,-1051523),n=b(n,s,r,e,t[1],21,-2054922799),e=b(e,n,s,r,t[8],6,1873313359),r=b(r,e,n,s,t[15],10,-30611744),s=b(s,r,e,n,t[6],15,-1560198380),n=b(n,s,r,e,t[13],21,1309151649),e=b(e,n,s,r,t[4],6,-145523070),r=b(r,e,n,s,t[11],10,-1120210379),s=b(s,r,e,n,t[2],15,718787259),n=b(n,s,r,e,t[9],21,-343485551),i[0]=a(e,i[0]),i[1]=a(n,i[1]),i[2]=a(s,i[2]),i[3]=a(r,i[3]);}var c=A;var v="0123456789abcdef".split(""),p=v;function B(i){let t="";for(let a=0;a<4;a++)t+=p[i>>a*8+4&15]+p[i>>a*8&15];return t}function x(i){let t=i.length,a=new Array(t);for(let e=0;e<t;e++)a[e]=B(i[e]);return a.join("")}var M=x;var F=[1732584193,-271733879,-1732584194,271733878],d=class i{constructor(t,a={}){this.result=null;this.resultResolver=null;this.consumed=false;this.bufferCapacity=64;this.buffer=new Uint8Array(this.bufferCapacity);this.sourceStream=t,this.state={state:[...F],bytesProcessed:0,bufferLength:0,buffer:this.buffer},this.add32=a.add32||m,this.resultPromise=new Promise(e=>{this.resultResolver=e;});}getReader(){if(this.consumed)throw new Error("Cannot get reader from MD5ReadableStream: stream has already been consumed");this.consumed=true;let{readable:t,writable:a}=new TransformStream({transform:async(e,n)=>{await this.processChunk(e),n.enqueue(e);},flush:async e=>{this.finalize(),this.resultResolver&&this.resultResolver(this.result);}});return this.sourceStream.pipeTo(a).catch(e=>{console.error("Error piping stream:",e),this.resultResolver&&this.resultResolver({digest:"",bytesProcessed:this.state.bytesProcessed});}),t.getReader()}async processChunk(t){let a;t instanceof Blob?a=new Uint8Array(await t.arrayBuffer()):t instanceof ArrayBuffer?a=new Uint8Array(t):a=t;let e=a.length;if(e===0)return;if(this.state.bufferLength>0){let r=this.state.bufferLength,u=64-r,o=Math.min(e,u);for(let f=0;f<o;f++)this.buffer[r+f]=a[f];if(this.state.bufferLength+=o,this.state.bufferLength===64&&this._processBufferBlock(),o===e)return;let l=e-o,b=new Uint8Array(l);for(let f=0;f<l;f++)b[f]=a[o+f];a=b;}let n=Math.floor(a.length/64);for(let r=0;r<n;r++){let u=r*64,o=[];for(let l=0;l<16;l++){let b=u+l*4;o[l]=a[b]+(a[b+1]<<8)+(a[b+2]<<16)+(a[b+3]<<24);}c(this.state.state,o,this.add32),this.state.bytesProcessed+=64;}let s=a.length%64;if(s>0){this.buffer.length<s&&(this.buffer=new Uint8Array(s),this.state.buffer=this.buffer);for(let r=0;r<s;r++)this.buffer[r]=a[n+r];this.state.bufferLength=s;}}_processBufferBlock(){let t=this.state.buffer,a=[];for(let e=0;e<16;e++){let n=e*4;a[e]=t[n]+(t[n+1]<<8)+(t[n+2]<<16)+(t[n+3]<<24);}c(this.state.state,a,this.add32),this.state.bytesProcessed+=64,this.state.bufferLength=0;}finalize(){let{state:t,bufferLength:a,buffer:e}=this.state,n=new Array(16).fill(0);for(let r=0;r<a;r++)n[r>>2]|=(e[r]&255)<<(r%4<<3);if(n[a>>2]|=128<<(a%4<<3),a>55){c(t,n,this.add32);for(let r=0;r<16;r++)n[r]=0;}n[14]=(this.state.bytesProcessed+a)*8,n[15]=0,c(t,n,this.add32);let s=M(t);this.result={digest:s,bytesProcessed:this.state.bytesProcessed+a};}getResult(){return this.resultPromise}getCurrentState(){return {state:[...this.state.state],bytesProcessed:this.state.bytesProcessed+this.state.bufferLength}}getBytesProcessed(){return this.state.bytesProcessed+this.state.bufferLength}static hash(t,a){let e=new i(t,a),n=e.getReader();return new Promise((s,r)=>{let u=0;n.read().then(function o({done:l,value:b}){if(l){s(e.getResult());return}u+=b.length,n.read().then(o);}).catch(r);})}static hashFile(t,a){let e=t.stream();return i.hash(e,a)}static hashBlob(t,a){return new Promise((e,n)=>{let s=new FileReader;s.onload=r=>{try{let u=r.target?.result,o=new ReadableStream({start(l){l.enqueue(new Uint8Array(u)),l.close();}});e(i.hash(o,a));}catch(u){n(u);}},s.onerror=()=>n(s.error),s.readAsArrayBuffer(t);})}};function H(i,t){return new d(i,t)}async function I(i,t){let a=i.getReader(),e=new d(i,t),n=0;for(;;){let{done:s,value:r}=await a.read();if(s)break;r&&(n+=r.length);}return e.getResult()}async function J(i,t){return d.hashFile(i,t)}async function K(i,t){return d.hashBlob(i,t)}async function N(i,t){let a=i.getReader(),e=new d(i,t),n=0;for(;;){let{done:s,value:r}=await a.read();if(s)break;r&&(n+=r.length);}return e.getResult()}exports.MD5ReadableStream=d;exports.consumeWithMD5=N;exports.createMD5ReadableStream=H;exports.hashBlob=K;exports.hashFile=J;exports.hashReadableStream=I;//# sourceMappingURL=whatwg-stream.cjs.map
2
- //# sourceMappingURL=whatwg-stream.cjs.map
1
+ 'use strict';function P(i,t){return i+t&4294967295}var m=P;function S(i,t,a,e,n){let s=n||m;return t=s(s(t,i),s(a,e)),t}function w(i,t,a,e){var s=(e||m)(i<<t|i>>>32-t,a);return s}function h(i,t,a,e,n,s,r){return t=S(i,t,e,s,r),w(t,n,a,r)}function y(i,t,a,e,n,s,r,u){return h(a&e|~a&n,t,a,s,r,u,i)}function R(i,t,a,e,n,s,r,u){return h(a&n|e&~n,t,a,s,r,u,i)}function g(i,t,a,e,n,s,r,u){return h(a^e^n,t,a,s,r,u,i)}function D(i,t,a,e,n,s,r,u){return h(e^(a|~n),t,a,s,r,u,i)}function A(i,t,a){typeof a>"u"&&(a=m);let e=i[0],n=i[1],s=i[2],r=i[3],u=y.bind(null,a);e=u(e,n,s,r,t[0],7,-680876936),r=u(r,e,n,s,t[1],12,-389564586),s=u(s,r,e,n,t[2],17,606105819),n=u(n,s,r,e,t[3],22,-1044525330),e=u(e,n,s,r,t[4],7,-176418897),r=u(r,e,n,s,t[5],12,1200080426),s=u(s,r,e,n,t[6],17,-1473231341),n=u(n,s,r,e,t[7],22,-45705983),e=u(e,n,s,r,t[8],7,1770035416),r=u(r,e,n,s,t[9],12,-1958414417),s=u(s,r,e,n,t[10],17,-42063),n=u(n,s,r,e,t[11],22,-1990404162),e=u(e,n,s,r,t[12],7,1804603682),r=u(r,e,n,s,t[13],12,-40341101),s=u(s,r,e,n,t[14],17,-1502002290),n=u(n,s,r,e,t[15],22,1236535329);let o=R.bind(null,a);e=o(e,n,s,r,t[1],5,-165796510),r=o(r,e,n,s,t[6],9,-1069501632),s=o(s,r,e,n,t[11],14,643717713),n=o(n,s,r,e,t[0],20,-373897302),e=o(e,n,s,r,t[5],5,-701558691),r=o(r,e,n,s,t[10],9,38016083),s=o(s,r,e,n,t[15],14,-660478335),n=o(n,s,r,e,t[4],20,-405537848),e=o(e,n,s,r,t[9],5,568446438),r=o(r,e,n,s,t[14],9,-1019803690),s=o(s,r,e,n,t[3],14,-187363961),n=o(n,s,r,e,t[8],20,1163531501),e=o(e,n,s,r,t[13],5,-1444681467),r=o(r,e,n,s,t[2],9,-51403784),s=o(s,r,e,n,t[7],14,1735328473),n=o(n,s,r,e,t[12],20,-1926607734);let l=g.bind(null,a);e=l(e,n,s,r,t[5],4,-378558),r=l(r,e,n,s,t[8],11,-2022574463),s=l(s,r,e,n,t[11],16,1839030562),n=l(n,s,r,e,t[14],23,-35309556),e=l(e,n,s,r,t[1],4,-1530992060),r=l(r,e,n,s,t[4],11,1272893353),s=l(s,r,e,n,t[7],16,-155497632),n=l(n,s,r,e,t[10],23,-1094730640),e=l(e,n,s,r,t[13],4,681279174),r=l(r,e,n,s,t[0],11,-358537222),s=l(s,r,e,n,t[3],16,-722521979),n=l(n,s,r,e,t[6],23,76029189),e=l(e,n,s,r,t[9],4,-640364487),r=l(r,e,n,s,t[12],11,-421815835),s=l(s,r,e,n,t[15],16,530742520),n=l(n,s,r,e,t[2],23,-995338651);let b=D.bind(null,a);e=b(e,n,s,r,t[0],6,-198630844),r=b(r,e,n,s,t[7],10,1126891415),s=b(s,r,e,n,t[14],15,-1416354905),n=b(n,s,r,e,t[5],21,-57434055),e=b(e,n,s,r,t[12],6,1700485571),r=b(r,e,n,s,t[3],10,-1894986606),s=b(s,r,e,n,t[10],15,-1051523),n=b(n,s,r,e,t[1],21,-2054922799),e=b(e,n,s,r,t[8],6,1873313359),r=b(r,e,n,s,t[15],10,-30611744),s=b(s,r,e,n,t[6],15,-1560198380),n=b(n,s,r,e,t[13],21,1309151649),e=b(e,n,s,r,t[4],6,-145523070),r=b(r,e,n,s,t[11],10,-1120210379),s=b(s,r,e,n,t[2],15,718787259),n=b(n,s,r,e,t[9],21,-343485551),i[0]=a(e,i[0]),i[1]=a(n,i[1]),i[2]=a(s,i[2]),i[3]=a(r,i[3]);}var c=A;var v="0123456789abcdef".split(""),p=v;function B(i){let t="";for(let a=0;a<4;a++)t+=p[i>>a*8+4&15]+p[i>>a*8&15];return t}function x(i){let t=i.length,a=new Array(t);for(let e=0;e<t;e++)a[e]=B(i[e]);return a.join("")}var M=x;var F=[1732584193,-271733879,-1732584194,271733878],d=class i{constructor(t,a={}){this.result=null;this.resultResolver=null;this.consumed=false;this.bufferCapacity=64;this.buffer=new Uint8Array(this.bufferCapacity);this.sourceStream=t,this.state={state:[...F],bytesProcessed:0,bufferLength:0,buffer:this.buffer},this.add32=a.add32||m,this.resultPromise=new Promise(e=>{this.resultResolver=e;});}getReader(){if(this.consumed)throw new Error("Cannot get reader from MD5ReadableStream: stream has already been consumed");this.consumed=true;let{readable:t,writable:a}=new TransformStream({transform:async(e,n)=>{await this.processChunk(e),n.enqueue(e);},flush:async e=>{this.finalize(),this.resultResolver&&this.resultResolver(this.result);}});return this.sourceStream.pipeTo(a).catch(e=>{console.error("Error piping stream:",e),this.resultResolver&&this.resultResolver({digest:"",bytesProcessed:this.state.bytesProcessed});}),t.getReader()}async processChunk(t){let a;t instanceof Blob?a=new Uint8Array(await t.arrayBuffer()):t instanceof ArrayBuffer?a=new Uint8Array(t):a=t;let e=a.length;if(e===0)return;if(this.state.bufferLength>0){let r=this.state.bufferLength,u=64-r,o=Math.min(e,u);for(let f=0;f<o;f++)this.buffer[r+f]=a[f];if(this.state.bufferLength+=o,this.state.bufferLength===64&&this._processBufferBlock(),o===e)return;let l=e-o,b=new Uint8Array(l);for(let f=0;f<l;f++)b[f]=a[o+f];a=b;}let n=Math.floor(a.length/64);for(let r=0;r<n;r++){let u=r*64,o=[];for(let l=0;l<16;l++){let b=u+l*4;o[l]=a[b]+(a[b+1]<<8)+(a[b+2]<<16)+(a[b+3]<<24);}c(this.state.state,o,this.add32),this.state.bytesProcessed+=64;}let s=a.length%64;if(s>0){this.buffer.length<s&&(this.buffer=new Uint8Array(s),this.state.buffer=this.buffer);for(let r=0;r<s;r++)this.buffer[r]=a[n+r];this.state.bufferLength=s;}}_processBufferBlock(){let t=this.state.buffer,a=[];for(let e=0;e<16;e++){let n=e*4;a[e]=t[n]+(t[n+1]<<8)+(t[n+2]<<16)+(t[n+3]<<24);}c(this.state.state,a,this.add32),this.state.bytesProcessed+=64,this.state.bufferLength=0;}finalize(){let{state:t,bufferLength:a,buffer:e}=this.state,n=new Array(16).fill(0);for(let r=0;r<a;r++)n[r>>2]|=(e[r]&255)<<(r%4<<3);if(n[a>>2]|=128<<(a%4<<3),a>55){c(t,n,this.add32);for(let r=0;r<16;r++)n[r]=0;}n[14]=(this.state.bytesProcessed+a)*8,n[15]=0,c(t,n,this.add32);let s=M(t);this.result={digest:s,bytesProcessed:this.state.bytesProcessed+a};}getResult(){return this.resultPromise}getCurrentState(){return {state:[...this.state.state],bytesProcessed:this.state.bytesProcessed+this.state.bufferLength}}getBytesProcessed(){return this.state.bytesProcessed+this.state.bufferLength}static hash(t,a){let e=new i(t,a),n=e.getReader();return new Promise((s,r)=>{let u=0;n.read().then(function o({done:l,value:b}){if(l){s(e.getResult());return}u+=b.length,n.read().then(o);}).catch(r);})}static hashFile(t,a){let e=t.stream();return i.hash(e,a)}static hashBlob(t,a){return new Promise((e,n)=>{let s=new FileReader;s.onload=r=>{try{let u=r.target?.result,o=new ReadableStream({start(l){l.enqueue(new Uint8Array(u)),l.close();}});e(i.hash(o,a));}catch(u){n(u);}},s.onerror=()=>n(s.error),s.readAsArrayBuffer(t);})}};function H(i,t){return new d(i,t)}async function I(i,t){let a=i.getReader(),e=new d(i,t),n=0;for(;;){let{done:s,value:r}=await a.read();if(s)break;r&&(n+=r.length);}return e.getResult()}async function J(i,t){return d.hashFile(i,t)}async function K(i,t){return d.hashBlob(i,t)}async function N(i,t){let a=i.getReader(),e=new d(i,t),n=0;for(;;){let{done:s,value:r}=await a.read();if(s)break;r&&(n+=r.length);}return e.getResult()}exports.MD5ReadableStream=d;exports.consumeWithMD5=N;exports.createMD5ReadableStream=H;exports.hashBlob=K;exports.hashFile=J;exports.hashReadableStream=I;
@@ -1,2 +1 @@
1
- export{a as MD5ReadableStream,f as consumeWithMD5,b as createMD5ReadableStream,e as hashBlob,d as hashFile,c as hashReadableStream}from'../chunk-XB5BQIEX.js';import'../chunk-R4JB5MBR.js';import'../chunk-2YXXFGBV.js';//# sourceMappingURL=whatwg-stream.js.map
2
- //# sourceMappingURL=whatwg-stream.js.map
1
+ export{a as MD5ReadableStream,f as consumeWithMD5,b as createMD5ReadableStream,e as hashBlob,d as hashFile,c as hashReadableStream}from'../chunk-BEGGPFEE.js';import'../chunk-DFR4GYL3.js';import'../chunk-I7AUKTXE.js';
@@ -1,4 +1,3 @@
1
1
  'use strict';var stream=require('stream');var C=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(e,s)=>(typeof require<"u"?require:e)[s]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var N="0123456789abcdef".split(""),U=N;function F(a){let e="";for(let s=0;s<4;s++)e+=U[a>>s*8+4&15]+U[a>>s*8&15];return e}function L(a){let e=a.length,s=new Array(e);for(let r=0;r<e;r++)s[r]=F(a[r]);return s.join("")}var v=L;function I(a,e){return a+e&4294967295}var m=I;function H(a,e,s,r,t){let n=t||m;return e=n(n(e,a),n(s,r)),e}function _(a,e,s,r){var n=(r||m)(a<<e|a>>>32-e,s);return n}function x(a,e,s,r,t,n,i){return e=H(a,e,r,n,i),_(e,t,s,i)}function W(a,e,s,r,t,n,i,c){return x(s&r|~s&t,e,s,n,i,c,a)}function R(a,e,s,r,t,n,i,c){return x(s&t|r&~t,e,s,n,i,c,a)}function T(a,e,s,r,t,n,i,c){return x(s^r^t,e,s,n,i,c,a)}function E(a,e,s,r,t,n,i,c){return x(r^(s|~t),e,s,n,i,c,a)}function G(a,e,s){typeof s>"u"&&(s=m);let r=a[0],t=a[1],n=a[2],i=a[3],c=W.bind(null,s);r=c(r,t,n,i,e[0],7,-680876936),i=c(i,r,t,n,e[1],12,-389564586),n=c(n,i,r,t,e[2],17,606105819),t=c(t,n,i,r,e[3],22,-1044525330),r=c(r,t,n,i,e[4],7,-176418897),i=c(i,r,t,n,e[5],12,1200080426),n=c(n,i,r,t,e[6],17,-1473231341),t=c(t,n,i,r,e[7],22,-45705983),r=c(r,t,n,i,e[8],7,1770035416),i=c(i,r,t,n,e[9],12,-1958414417),n=c(n,i,r,t,e[10],17,-42063),t=c(t,n,i,r,e[11],22,-1990404162),r=c(r,t,n,i,e[12],7,1804603682),i=c(i,r,t,n,e[13],12,-40341101),n=c(n,i,r,t,e[14],17,-1502002290),t=c(t,n,i,r,e[15],22,1236535329);let o=R.bind(null,s);r=o(r,t,n,i,e[1],5,-165796510),i=o(i,r,t,n,e[6],9,-1069501632),n=o(n,i,r,t,e[11],14,643717713),t=o(t,n,i,r,e[0],20,-373897302),r=o(r,t,n,i,e[5],5,-701558691),i=o(i,r,t,n,e[10],9,38016083),n=o(n,i,r,t,e[15],14,-660478335),t=o(t,n,i,r,e[4],20,-405537848),r=o(r,t,n,i,e[9],5,568446438),i=o(i,r,t,n,e[14],9,-1019803690),n=o(n,i,r,t,e[3],14,-187363961),t=o(t,n,i,r,e[8],20,1163531501),r=o(r,t,n,i,e[13],5,-1444681467),i=o(i,r,t,n,e[2],9,-51403784),n=o(n,i,r,t,e[7],14,1735328473),t=o(t,n,i,r,e[12],20,-1926607734);let u=T.bind(null,s);r=u(r,t,n,i,e[5],4,-378558),i=u(i,r,t,n,e[8],11,-2022574463),n=u(n,i,r,t,e[11],16,1839030562),t=u(t,n,i,r,e[14],23,-35309556),r=u(r,t,n,i,e[1],4,-1530992060),i=u(i,r,t,n,e[4],11,1272893353),n=u(n,i,r,t,e[7],16,-155497632),t=u(t,n,i,r,e[10],23,-1094730640),r=u(r,t,n,i,e[13],4,681279174),i=u(i,r,t,n,e[0],11,-358537222),n=u(n,i,r,t,e[3],16,-722521979),t=u(t,n,i,r,e[6],23,76029189),r=u(r,t,n,i,e[9],4,-640364487),i=u(i,r,t,n,e[12],11,-421815835),n=u(n,i,r,t,e[15],16,530742520),t=u(t,n,i,r,e[2],23,-995338651);let f=E.bind(null,s);r=f(r,t,n,i,e[0],6,-198630844),i=f(i,r,t,n,e[7],10,1126891415),n=f(n,i,r,t,e[14],15,-1416354905),t=f(t,n,i,r,e[5],21,-57434055),r=f(r,t,n,i,e[12],6,1700485571),i=f(i,r,t,n,e[3],10,-1894986606),n=f(n,i,r,t,e[10],15,-1051523),t=f(t,n,i,r,e[1],21,-2054922799),r=f(r,t,n,i,e[8],6,1873313359),i=f(i,r,t,n,e[15],10,-30611744),n=f(n,i,r,t,e[6],15,-1560198380),t=f(t,n,i,r,e[13],21,1309151649),r=f(r,t,n,i,e[4],6,-145523070),i=f(i,r,t,n,e[11],10,-1120210379),n=f(n,i,r,t,e[2],15,718787259),t=f(t,n,i,r,e[9],21,-343485551),a[0]=s(r,a[0]),a[1]=s(t,a[1]),a[2]=s(n,a[2]),a[3]=s(i,a[3]);}var l=G;function $(a){let e=[];for(let s=0;s<64;s+=4)e[s>>2]=(a.charCodeAt(s)||0)+((a.charCodeAt(s+1)||0)<<8)+((a.charCodeAt(s+2)||0)<<16)+((a.charCodeAt(s+3)||0)<<24);return e}var O=$;function K(a,e){let s=a.length,r=[1732584193,-271733879,-1732584194,271733878],t;for(t=64;t<=s;t+=64)l(r,O(a.substring(t-64,t)),e);a=a.substring(t-64);var n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=a.length;for(t=0;t<i;t++)n[t>>2]|=(a.charCodeAt(t)&255)<<(t%4<<3);if(n[t>>2]|=128<<(t%4<<3),t>55)for(l(r,n,e),t=16;t--;)n[t]=0;return n[14]=s*8,l(r,n,e),r}var j=K;function y(a){return v(j(a,m))}var g=class{constructor(){this.name="webcrypto";this.version="1.0.0";}static isAvailable(){return typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof crypto.subtle.digest=="function"}async hash(e){return y(e)}async hashBinary(e){let s=e instanceof ArrayBuffer?new TextDecoder().decode(e):new TextDecoder().decode(e);return y(s)}update(e){throw new Error("Web Crypto API does not support streaming updates")}digest(e){throw new Error("Web Crypto API does not support streaming")}reset(){}};var w=class{constructor(){this.name="nodecrypto";this.version="1.0.0";}static isAvailable(){try{return typeof C("crypto").createHash=="function"}catch{return false}}hash(e){return C("crypto").createHash("md5").update(e).digest("hex")}async hashBinary(e){let s=C("crypto"),r=e instanceof Uint8Array?e:new Uint8Array(e);return s.createHash("md5").update(r).digest("hex")}update(e){}digest(e){throw new Error("Node crypto streaming not implemented")}reset(){}};var A=class{constructor(){this.name="ie11";this.version="1.0.0";}static isAvailable(){if(typeof window>"u")return false;let e=window;return typeof e.msCrypto<"u"&&typeof e.msCrypto.subtle<"u"&&typeof e.msCrypto.subtle.digest=="function"}async hash(e){let r=new TextEncoder().encode(e);return await this.hashBinary(r)}async hashBinary(e){let s=window,r=e instanceof Uint8Array?e.buffer:e,t=await s.msCrypto.subtle.digest("MD5",r);return this.bufferToHex(t)}bufferToHex(e){return Array.from(new Uint8Array(e)).map(s=>s.toString(16).padStart(2,"0")).join("")}update(e){throw new Error("msCrypto does not support streaming updates")}digest(e){throw new Error("msCrypto does not support streaming")}reset(){}};var P=class{constructor(){this.name="purejs";this.version="0.1.0";this.state={data:"",finished:false};}hash(e){return y(e)}async hashBinary(e){let s=e instanceof ArrayBuffer?new TextDecoder().decode(e):new TextDecoder().decode(e);return y(s)}update(e){this.state.finished&&(this.state={data:"",finished:false}),e instanceof ArrayBuffer?this.state.data+=new TextDecoder().decode(e):e instanceof Uint8Array?this.state.data+=new TextDecoder().decode(e):this.state.data+=e;}digest(e){let s=y(this.state.data);return this.state.finished=true,e==="buffer"?this.hexToBuffer(s):s}reset(){this.state={data:"",finished:false};}static isAvailable(){return true}hexToBuffer(e){let s=[];for(let r=0;r<e.length;r+=2)s.push(parseInt(e.substring(r,r+2),16));return new Uint8Array(s)}};var B=class a extends stream.Transform{constructor(s){super({readableObjectMode:false,writableObjectMode:false});this.initialMD5State=[1732584193,-271733879,-1732584194,271733878];this.bufferCapacity=64;this.buffer=new Uint8Array(this.bufferCapacity);this.add32=s?.add32||m,this.state={state:[...this.initialMD5State],bytesProcessed:0,bufferLength:0,buffer:this.buffer};}_transform(s,r,t){try{let n=s,i=n.length;if(i===0){t();return}if(this.state.bufferLength>0){let u=this.state.bufferLength,f=64-u,b=Math.min(i,f);for(let d=0;d<b;d++)this.buffer[u+d]=n[d];if(this.state.bufferLength+=b,this.state.bufferLength===64&&this._processBufferBlock(),b===i){t();return}let p=i-b;for(let d=0;d<p;d++)n[d]=n[b+d];let h=Buffer.alloc(p);for(let d=0;d<p;d++)h[d]=n[d];n=h;}let c=Math.floor(n.length/64);for(let u=0;u<c;u++){let f=u*64,b=[];for(let p=0;p<16;p++){let h=f+p*4;b[p]=n[h]+(n[h+1]<<8)+(n[h+2]<<16)+(n[h+3]<<24);}l(this.state.state,b,this.add32),this.state.bytesProcessed+=64;}let o=n.length%64;if(o>0){this.buffer.length<o&&(this.buffer=new Uint8Array(o),this.state.buffer=this.buffer);for(let u=0;u<o;u++)this.buffer[u]=n[c*64+u];this.state.bufferLength=o;}t();}catch(n){t(n);}}_processBufferBlock(){let s=this.state.buffer,r=[];for(let t=0;t<16;t++){let n=t*4;r[t]=s[n]+(s[n+1]<<8)+(s[n+2]<<16)+(s[n+3]<<24);}l(this.state.state,r,this.add32),this.state.bytesProcessed+=64,this.state.bufferLength=0;}_flush(s){try{let{state:r,bufferLength:t,buffer:n}=this.state,i=new Array(16).fill(0);for(let o=0;o<t;o++)i[o>>2]|=(n[o]&255)<<(o%4<<3);if(i[t>>2]|=128<<(t%4<<3),t>55){l(r,i,this.add32);for(let o=0;o<16;o++)i[o]=0;}i[14]=(this.state.bytesProcessed+t)*8,i[15]=0,l(r,i,this.add32);let c=v(r);this.emit("md5",{digest:c,bytesProcessed:this.state.bytesProcessed+t}),s();}catch(r){s(r);}}getCurrentState(){return {state:[...this.state.state],bytesProcessed:this.state.bytesProcessed+this.state.bufferLength}}getBytesProcessed(){return this.state.bytesProcessed+this.state.bufferLength}reset(){this.state={state:[...this.initialMD5State],bytesProcessed:0,bufferLength:0,buffer:this.buffer},this.buffer=new Uint8Array(this.bufferCapacity),this.state.buffer=this.buffer,this.state.bufferLength=0;}static fromStream(s,r){let t=new a(r),n=z.call(t,s);return {stream:t,result:n}}};async function z(a){return new Promise((e,s)=>{let r=[];a.pipe(this).on("md5",t=>{r.push(t);}).on("error",s).on("finish",()=>{e(r[0]);});})}var D=class{constructor(){this.name="stream";this.version="0.1.0";this.state=null;}initNodeStream(e){this.state={stream:e,type:"node"};}initWhatWGStream(e){this.state={stream:e,type:"whatwg"};}async hash(e){let s=new B;return (await new Promise((t,n)=>{s.on("md5",i=>t(i)).on("error",n).end(e);})).digest}async hashBinary(e){let s=new B,r;return e instanceof Uint8Array?r=Buffer.from(e):e instanceof ArrayBuffer?r=Buffer.from(new Uint8Array(e)):r=Buffer.from(e),(await new Promise((n,i)=>{s.on("md5",c=>n(c)).on("error",i).end(r);})).digest}update(e){if(!this.state)throw new Error("Stream backend not initialized. Call initNodeStream() or initWhatWGStream() first.");if(this.state.type==="node"){let s=this.state.stream,r;typeof e=="string"||e instanceof Uint8Array?r=Buffer.from(e):e instanceof ArrayBuffer?r=Buffer.from(new Uint8Array(e)):r=Buffer.from(e),s.write(r);}}digest(e){if(!this.state)throw new Error("Stream backend not initialized. Call initNodeStream() or initWhatWGStream() first.");if(this.state.type==="node"){let s=this.state.stream;return s.end(),new Promise((r,t)=>{s.on("md5",n=>{if(e==="buffer"){let i=n.digest,c=[];for(let o=0;o<i.length;o+=2)c.push(parseInt(i.substring(o,o+2),16));r(Buffer.from(c));}else r(n.digest);}).on("error",t);})}else return this.state.stream.getResult().then(r=>r.digest)}reset(){this.state&&this.state.type==="node"&&this.state.stream.reset();}static isAvailable(){return true}};var J=(t=>(t.BROWSER="browser",t.NODE="node",t.WEBWORKER="webworker",t.UNKNOWN="unknown",t))(J||{});function Ne(){return typeof process<"u"&&process.versions&&process.versions.node?"node":typeof importScripts<"u"?"webworker":typeof window<"u"&&window.document?"browser":"unknown"}function Fe(){return typeof process<"u"&&process.versions!==void 0&&"node"in process.versions}function Le(){return typeof window<"u"&&typeof document<"u"}function Ie(){return typeof importScripts<"u"}async function Y(a){switch(a){case "webcrypto":let e=g.isAvailable();return {backend:"webcrypto",available:e,reason:e?void 0:"Web Crypto API not available"};case "nodecrypto":let s=w.isAvailable();return {backend:"nodecrypto",available:s,reason:s?void 0:"Node.js crypto not available"};case "ie11":let r=A.isAvailable();return {backend:"ie11",available:r,reason:r?void 0:"IE11 msCrypto not available"};case "purejs":return {backend:"purejs",available:true,reason:"Always available"};case "stream":let t=typeof process<"u"&&process.versions&&"node"in process.versions,n=typeof window<"u";return {backend:"stream",available:t||n,reason:t||n?void 0:"Streams not available"};default:return {backend:a||"unknown",available:false,reason:"Unknown backend"}}}async function Q(){let a=["webcrypto","nodecrypto","ie11","purejs","stream"],e=[];for(let s of a){let{available:r}=await Y(s);r&&e.push(s);}return e}var V=[{name:"nodecrypto",priority:1,description:"Node.js native crypto (fastest)"},{name:"webcrypto",priority:2,description:"Web Crypto API (fast, hardware accelerated)"},{name:"ie11",priority:3,description:"IE11 msCrypto (legacy)"},{name:"stream",priority:4,description:"Streaming backend (for large files and memory efficiency)"},{name:"purejs",priority:5,description:"Pure JavaScript (always available, slower)"}];function X(a){let e=[...V].sort((s,r)=>s.priority-r.priority);for(let{name:s}of e)if(a.includes(s))return s;return "purejs"}var M=class a{constructor(){}static getInstance(){return a.instance||(a.instance=new a),a.instance}async createBackendByName(e){switch(e){case "nodecrypto":return new w;case "webcrypto":return new g;case "ie11":return new A;case "stream":return new D;default:return new P}}async createBackend(e){let s=e||X(await Q());return this.createBackendByName(s)}},He=M.getInstance(),S=class{constructor(e=["nodecrypto","webcrypto","stream","ie11","purejs"]){this.detector=M.getInstance(),this.fallbackOrder=e;}async execute(e){let s=[];for(let r of this.fallbackOrder)try{let t=await this.detector.createBackendByName(r),n=await e(t);return {success:!0,backend:r,data:n}}catch(t){if(s.push({backend:r,error:t}),r===this.fallbackOrder[this.fallbackOrder.length-1])return {success:false,backend:r,data:null,errors:s}}return {success:false,backend:"",data:null,errors:s}}async hash(e){return this.execute(async s=>s.hash(e))}async hashBinary(e){return this.execute(async s=>s.hashBinary(e))}async getBestBackend(){let e=await this.getAvailableBackends();return e.length===0?"purejs":e[0]}async getAvailableBackends(){let e=[];for(let s of this.fallbackOrder)try{await this.detector.createBackendByName(s),e.push(s);}catch{}return e}getMetrics(){return {}}},_e=new S;async function Ge(a,e={}){let s=new S;if(e.forceBackend)return (await s.detector.createBackendByName(e.forceBackend)).hash(a);if(e.fallback===false)return (await s.detector.createBackend()).hash(a);let r=await s.hash(a);if(r.success)return e.reportFallback&&r.backend!=="nodecrypto"&&r.backend!=="webcrypto"&&console.info(`MD5 used fallback backend: ${r.backend}`),r.data;let t=r.errors?r.errors.map(n=>`${n.backend}: ${n.error.message}`).join(", "):"All backends failed";throw new Error(`MD5 hash failed after all attempts: ${t}`)}var k=class{constructor(){this.metrics={nodecrypto:{success:0,fail:0},webcrypto:{success:0,fail:0},ie11:{success:0,fail:0},stream:{success:0,fail:0},purejs:{success:0,fail:0}};}recordSuccess(e){this.metrics[e]&&this.metrics[e].success++;}recordFail(e){this.metrics[e]&&this.metrics[e].fail++;}getMetrics(){return this.metrics}getSummary(){return `Total operations: ${Object.values(this.metrics).reduce((s,r)=>s+r.success+r.fail,0)}
2
2
  `+Object.entries(this.metrics).map(([,s])=>`${s.success} success, ${s.fail} fail`).join(`
3
- `)}reset(){Object.keys(this.metrics).forEach(e=>{this.metrics[e]={success:0,fail:0};});}},$e=new k;exports.BACKEND_PRIORITY=V;exports.BackendDetector=M;exports.FallbackManager=S;exports.MetricsCollector=k;exports.RuntimeEnvironment=J;exports.checkBackendAvailability=Y;exports.detectEnvironment=Ne;exports.detector=He;exports.fallbackManager=_e;exports.getAllAvailableBackends=Q;exports.getBestAvailableBackend=X;exports.isBrowser=Le;exports.isNode=Fe;exports.isWebWorker=Ie;exports.metrics=$e;exports.robustHash=Ge;//# sourceMappingURL=detect.cjs.map
4
- //# sourceMappingURL=detect.cjs.map
3
+ `)}reset(){Object.keys(this.metrics).forEach(e=>{this.metrics[e]={success:0,fail:0};});}},$e=new k;exports.BACKEND_PRIORITY=V;exports.BackendDetector=M;exports.FallbackManager=S;exports.MetricsCollector=k;exports.RuntimeEnvironment=J;exports.checkBackendAvailability=Y;exports.detectEnvironment=Ne;exports.detector=He;exports.fallbackManager=_e;exports.getAllAvailableBackends=Q;exports.getBestAvailableBackend=X;exports.isBrowser=Le;exports.isNode=Fe;exports.isWebWorker=Ie;exports.metrics=$e;exports.robustHash=Ge;
@@ -1,2 +1 @@
1
- export{i as BACKEND_PRIORITY,k as BackendDetector,m as FallbackManager,p as MetricsCollector,b as RuntimeEnvironment,g as checkBackendAvailability,c as detectEnvironment,l as detector,n as fallbackManager,h as getAllAvailableBackends,j as getBestAvailableBackend,e as isBrowser,d as isNode,f as isWebWorker,q as metrics,o as robustHash}from'../chunk-6P2QV5SR.js';import'../chunk-VFOAY6XI.js';import'../chunk-PNZTVQA7.js';import'../chunk-G5WHEAIQ.js';import'../chunk-4KSCMS4Q.js';import'../chunk-NWQ4N5RX.js';import'../chunk-JKVD5LHZ.js';import'../chunk-R4JB5MBR.js';import'../chunk-2YXXFGBV.js';//# sourceMappingURL=detect.js.map
2
- //# sourceMappingURL=detect.js.map
1
+ export{i as BACKEND_PRIORITY,k as BackendDetector,m as FallbackManager,p as MetricsCollector,b as RuntimeEnvironment,g as checkBackendAvailability,c as detectEnvironment,l as detector,n as fallbackManager,h as getAllAvailableBackends,j as getBestAvailableBackend,e as isBrowser,d as isNode,f as isWebWorker,q as metrics,o as robustHash}from'../chunk-4F2Y3CRO.js';import'../chunk-QB6MF5LD.js';import'../chunk-XPYPJSJE.js';import'../chunk-43QQAXLT.js';import'../chunk-Y2ZKN4NS.js';import'../chunk-Z4JB6DTM.js';import'../chunk-MIU3X4SB.js';import'../chunk-DFR4GYL3.js';import'../chunk-I7AUKTXE.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pure-md5",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "A lightweight JavaScript function for hashing messages by the MD5 algorithm",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
Binary file
package/.aliases DELETED
@@ -1,19 +0,0 @@
1
- # Detect which `ls` flavor is in use
2
- if ls --color > /dev/null 2>&1; then # GNU `ls`
3
- colorflag="--color"
4
- else # OS X `ls`
5
- colorflag="-G"
6
- fi
7
-
8
- # List all files colorized in long format
9
- alias ll='ls -lh'
10
-
11
- # List all files colorized in long format, including dot files
12
- alias la="ls -lha"
13
-
14
- # List only directories
15
- alias lsd='ls -l | grep "^d"'
16
-
17
- # Always use color output for `ls`
18
- alias ls="command ls ${colorflag}"
19
- export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'
package/.bash_profile DELETED
@@ -1,12 +0,0 @@
1
- # Add Homebrew `/usr/local/bin` and User `~/bin` to the `$PATH`
2
- PATH=/usr/local/bin:$PATH
3
- PATH=$HOME/bin:$PATH
4
- export PATH
5
-
6
- # Load the shell dotfiles, and then some:
7
- # * ~/.path can be used to extend `$PATH`.
8
- # * ~/.extra can be used for other settings you don’t want to commit.
9
- for file in ~/.{path,bash_prompt,exports,aliases,functions,extra}; do
10
- [ -r "$file" ] && source "$file"
11
- done
12
- unset file