Skip to content

v0.9.0 - #44

Closed
cyfung1031 wants to merge 1 commit into
emn178:masterfrom
cyfung1031:patch-0.9.0
Closed

v0.9.0#44
cyfung1031 wants to merge 1 commit into
emn178:masterfrom
cyfung1031:patch-0.9.0

Conversation

@cyfung1031

@cyfung1031 cyfung1031 commented Jan 13, 2024

Copy link
Copy Markdown
Contributor

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

@emn178

emn178 commented Jan 24, 2024

Copy link
Copy Markdown
Owner

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

emn178 added a commit that referenced this pull request Jul 20, 2026
- web worker detection. #44
@emn178

emn178 commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Thanks for the pull request and for proposing the lite build idea.

I have implemented this using a different build structure based on Rollup and build-time feature flags. The package now generates full, modern, and lite variants from the same source, including UMD, browser ESM, Node ESM, and minified builds.

The lite build removes HMAC, Base64, the deprecated buffer alias, and legacy compatibility code through tree-shaking.

I decided not to include some unrelated changes from this PR:

  • Test pages will continue using dependencies from node_modules so tests remain reproducible and can run offline.
  • A separate build-bun script is unnecessary because Bun users can already run the existing scripts with bun run.

Since the implementation now differs substantially and the requested functionality has been implemented separately, I’m going to close this pull request.

Thanks again for the contribution and the original idea.

@emn178 emn178 closed this Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants