js-md5 icon indicating copy to clipboard operation
js-md5 copied to clipboard

v0.9.0

Open cyfung1031 opened this issue 1 year ago • 1 comments

I noticed that there are many compatibile codes but they are useless nowadays since all browsers are supporting those features, no polyfill is required.

To further minimize the node, there should be a md5-lite.min.js output file if you still want to keep the polyfills in the original version. Also, I am doubt about the hmac necessity. It seems no use to have hmac so that this is not included in md5-lite as well.

there are full.config.js and lite.config.js in src/config such that when uglifyjs run the compression, it can remove the polyfill in the lite version and keep them in the full version.

I have also updated the related testing such that the coverage report can reach 100%, by including the options for lite version.

To summary, lite version excludes md5.hmac and can run in all modern environments including Node 10+, Worker, Edge, Chrome, Firefox, Safari, except IE.

There are also some minor changes:

  • Update uglify-js from 3.1.9 to 3.17.4
  • In addition to compress and build, there are compress-lite (md5.lite.js) and build-bun (use bun instead of node to build)
  • Added dist-src and dist-lite to for the output file in pretty format (they can be deleted or moved to testing output)
  • Changed to node_modules script link in testing html pages to CDN links
  • Changed Worker detection to WorkerGlobalScope

File Size Reduction

  • md5.min.js (0.8.3): 10 KB
  • md5.min.js (0.9.0): 9 KB
  • md5-lite.min.js: 8 KB

cyfung1031 avatar Jan 13 '24 08:01 cyfung1031

Thank you for PR, I will review this when I have time.

emn178 avatar Jan 24 '24 02:01 emn178