{"_id":"@bybrave/md5","_rev":"2-8750b8b114b12687ed2fa295f593ac90","name":"@bybrave/md5","dist-tags":{"latest":"5.0.1"},"versions":{"5.0.0":{"name":"@bybrave/md5","version":"5.0.0","keywords":["md5","hash","digest","message-digest","crypto","esm","typescript"],"author":{"name":"bybrave"},"license":"BSD-3-Clause","_id":"@bybrave/md5@5.0.0","maintainers":[{"name":"bybrave","email":"opmybrave@gmail.com"}],"homepage":"https://github.com/bybraveHQ/md5#readme","bugs":{"url":"https://github.com/bybraveHQ/md5/issues"},"dist":{"shasum":"e3e084f18857cc314c8be1e6f5fccfaf30d1dfb3","tarball":"https://registry.npmjs.org/@bybrave/md5/-/md5-5.0.0.tgz","fileCount":7,"integrity":"sha512-YpdiSY4fmuojYEx9UmNlWEnTdRzsloJb6A3d9kE7Pzavgr0JSFUgjKHMoyzCo827ZNo/DkN7iHTHWcpxnqqhHA==","signatures":[{"sig":"MEQCIBrt0X1yAtb2ofJoKbmYCBpNyAFXQ34e++LhrFaDuvlTAiBAl/c/OnqrL27nu97xOMYgzCTMZywtPTjbkTeqT/jBUg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22570},"main":"./dist/index.cjs","type":"module","types":"./index.d.ts","module":"./index.js","engines":{"node":">=18"},"exports":{".":{"types":"./index.d.ts","import":"./index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"4f4f3df04d707a98eb93dd37d1d02c2802ac7c59","scripts":{"test":"node --test","build":"node build/build.js","test-types":"tsc --strict --noEmit --moduleResolution bundler --target es2020 --types node test/types.ts","prepublishOnly":"npm run build && npm test && npm run test-types"},"_npmUser":{"name":"bybrave","email":"opmybrave@gmail.com"},"repository":{"url":"git+https://github.com/bybraveHQ/md5.git","type":"git"},"_npmVersion":"10.8.2","description":"Maintained MD5 fork: zero runtime dependencies, ESM + CommonJS, built-in TypeScript types, correct ArrayBuffer/TypedArray/DataView hashing. Drop-in for md5.","directories":{},"sideEffects":false,"_nodeVersion":"20.19.6","_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.24.0","typescript":"^5.6.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/md5_5.0.0_1783256008927_0.5829387930195671","host":"s3://npm-registry-packages-npm-production"}},"5.0.1":{"name":"@bybrave/md5","version":"5.0.1","description":"Maintained MD5 fork: zero runtime dependencies, ESM + CommonJS, built-in TypeScript types, correct ArrayBuffer/TypedArray/DataView hashing. Drop-in for md5.","type":"module","main":"./dist/index.cjs","module":"./index.js","types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","import":"./index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"sideEffects":false,"scripts":{"build":"node build/build.js","test":"node --test","test-types":"tsc --strict --noEmit --moduleResolution bundler --target es2020 --types node test/types.ts","prepublishOnly":"npm run build && npm test && npm run test-types"},"keywords":["md5","hash","digest","message-digest","crypto","esm","typescript"],"author":{"name":"bybrave"},"license":"BSD-3-Clause","repository":{"type":"git","url":"git+https://github.com/bybraveHQ/md5.git"},"bugs":{"url":"https://github.com/bybraveHQ/md5/issues"},"homepage":"https://github.com/bybraveHQ/md5#readme","engines":{"node":">=18"},"devDependencies":{"esbuild":"^0.24.0","typescript":"^5.6.0","@types/node":"^22.0.0"},"_id":"@bybrave/md5@5.0.1","gitHead":"87165a8e4be89e101c7a04a3ae3b446746bd79e8","_nodeVersion":"20.19.6","_npmVersion":"10.8.2","dist":{"integrity":"sha512-b87zOOv6MXP3T+uAjCAyAdZsKWIibDPyfFayv5ZSdgeJ8u66FVUIvkDN6fn87nZ7FwJUsy5WO3vD+OhB374avA==","shasum":"726124b96a90218e7e74ad15fb7492792d9ff93a","tarball":"https://registry.npmjs.org/@bybrave/md5/-/md5-5.0.1.tgz","fileCount":7,"unpackedSize":22937,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEd5xLhNoaJH3HZdKowWOHT8EeEGWUYcj/R34XURJhmnAiEAsEA/6Z94EhHEkBD9sNBfK/psldTiOzjAYjqk6jbFflg="}]},"_npmUser":{"name":"bybrave","email":"opmybrave@gmail.com"},"directories":{},"maintainers":[{"name":"bybrave","email":"opmybrave@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/md5_5.0.1_1783297198231_0.34474083308008674"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-05T12:53:28.687Z","modified":"2026-07-06T00:19:58.481Z","5.0.0":"2026-07-05T12:53:29.060Z","5.0.1":"2026-07-06T00:19:58.375Z"},"bugs":{"url":"https://github.com/bybraveHQ/md5/issues"},"author":{"name":"bybrave"},"license":"BSD-3-Clause","homepage":"https://github.com/bybraveHQ/md5#readme","keywords":["md5","hash","digest","message-digest","crypto","esm","typescript"],"repository":{"type":"git","url":"git+https://github.com/bybraveHQ/md5.git"},"description":"Maintained MD5 fork: zero runtime dependencies, ESM + CommonJS, built-in TypeScript types, correct ArrayBuffer/TypedArray/DataView hashing. Drop-in for md5.","maintainers":[{"name":"bybrave","email":"opmybrave@gmail.com"}],"readme":"# @bybrave/md5\n\nMaintained fork of [`md5`](https://www.npmjs.com/package/md5) — a JS function for hashing messages with MD5.\n\nSame API, **zero runtime dependencies**, dual **ESM + CommonJS**, **built-in TypeScript types**, and correct hashing of `ArrayBuffer` / `TypedArray` / `DataView`.\n\n> ⚠️ MD5 is **not** cryptographically secure. Use it for checksums, cache keys, ETags and non-security fingerprints — never for passwords or signatures.\n\n## Install\n\n```sh\nnpm install @bybrave/md5\n```\n\n## Usage\n\n```js\nimport md5 from '@bybrave/md5';\n\nmd5('message'); // \"78e731027d8fd50ed642340b7c9a63b3\"\n```\n\nCommonJS works too — `require` returns the function directly, exactly like the original:\n\n```js\nconst md5 = require('@bybrave/md5');\nmd5('message');\n```\n\nAccepts strings, `Buffer`, `ArrayBuffer`, any `TypedArray`/`DataView`, and byte arrays:\n\n```js\nmd5(Buffer.from('message'));\nmd5(new Uint8Array([1, 2, 3]));\nmd5(new ArrayBuffer(8));\n```\n\n### Options\n\n| Option | Type | Effect |\n|---|---|---|\n| `asBytes` | `boolean` | Return the digest as a 16-element byte array instead of a hex string. |\n| `asString` | `boolean` | Return the digest as a 16-char binary string instead of a hex string. |\n| `encoding` | `'binary'` | Treat a string input as latin1 bytes instead of UTF-8. |\n\n```js\nmd5('abc', { asBytes: true });  // [ 144, 1, 80, ... ]  (length 16)\nmd5('abc', { asString: true }); // 16-char binary string\nmd5('abc', { encoding: 'binary' });\n```\n\n## What's fixed vs `md5@2.3.0`\n\n| Issue | Fix |\n|---|---|\n| [#49](https://github.com/pvorb/node-md5/issues/49) | `ArrayBuffer`, `DataView` and non-`Uint8Array` typed arrays were coerced via `toString()` (`\"[object ArrayBuffer]\"`) and produced a wrong digest. They now hash the actual buffer bytes — `md5(arrayBuffer)` matches `md5(new Uint8Array(arrayBuffer))`. |\n| [#82](https://github.com/pvorb/node-md5/issues/82), [#68](https://github.com/pvorb/node-md5/pull/68) | Ships as native ESM with a CommonJS build via the `exports` map — `import` and `require` both work. |\n| [#83](https://github.com/pvorb/node-md5/issues/83) | `asBytes` / `asString` / `encoding` options are documented (see above). |\n| [#79](https://github.com/pvorb/node-md5/issues/79) | Number/object input is now coerced to its string form before hashing, so `md5(1003) === md5('1003')`. Previously a raw number produced an inconsistent, undocumented result. |\n| — | Built-in TypeScript types — no separate `@types/md5` needed. |\n| — | Zero runtime dependencies (`charenc`, `crypt`, `is-buffer` inlined). |\n\n## Migration from `md5`\n\nDrop-in for the common cases — replace the import:\n\n```diff\n- const md5 = require('md5');\n+ const md5 = require('@bybrave/md5');\n```\n\nHashes for **strings, `Buffer`, `Uint8Array` and byte arrays are byte-for-byte identical** to `md5@2.3.0`.\n\nTwo intentional behaviour changes in this major release:\n\n- **`ArrayBuffer` / `DataView` / other typed arrays** now hash their real bytes (they were broken before — see #49).\n- **Raw numbers/objects** now hash as `String(value)` (`md5(1003) === md5('1003')`). If you relied on the old number coercion, pass a string explicitly to reproduce a specific legacy value.\n\n## Support\n\nIf this package saves you time, you can support maintenance:\n\n[![Ko-fi](https://img.shields.io/badge/Ko--fi-buy%20me%20a%20coffee-FF5E5B?logo=kofi&logoColor=white)](https://ko-fi.com/bybrave)\n[![Bitcoin](https://img.shields.io/badge/Bitcoin-BTC-F7931A?logo=bitcoin&logoColor=white)](#support)\n\nBitcoin (BTC): `bc1q37557q5jpeaxqydzwvf3jgj7zhnfpn2td3q40q`\n\n## License\n\nBSD-3-Clause. Copyright © Paul Vorbach, Jeff Mott; fork © bybrave.\n","readmeFilename":"README.md"}