tag:github.com,2008:https://github.com/dcodeIO/bcrypt.js/releasesRelease notes from bcrypt.js2025-11-02T22:08:07Ztag:github.com,2008:Repository/9784843/v3.0.32025-11-02T22:09:44Zv3.0.3<h3>Bug fixes</h3>
<ul>
<li><strong>Always yield to event loop before nextTick for async versions (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="3579428485" data-permission-text="Title is private" data-url="https://github.com/dcodeIO/bcrypt.js/issues/164" data-hovercard-type="pull_request" data-hovercard-url="/dcodeIO/bcrypt.js/pull/164/hovercard" href="https://github.com/dcodeIO/bcrypt.js/pull/164">#164</a>)</strong> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/dcodeIO/bcrypt.js/commit/1211e9a2213e0b3ee232a204b3ce899beebce31a/hovercard" href="https://github.com/dcodeIO/bcrypt.js/commit/1211e9a2213e0b3ee232a204b3ce899beebce31a"><tt>1211e9a</tt></a>)</li>
</ul>github-actions[bot]tag:github.com,2008:Repository/9784843/v3.0.22025-02-18T19:52:49Zv3.0.2<h3>Bug fixes</h3>
<ul>
<li><strong>Use upstream fix to emit interop helpers</strong> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/dcodeIO/bcrypt.js/commit/28e510389374f5736c447395443d4a6687325048/hovercard" href="https://github.com/dcodeIO/bcrypt.js/commit/28e510389374f5736c447395443d4a6687325048"><tt>28e5103</tt></a>)</li>
</ul>github-actions[bot]tag:github.com,2008:Repository/9784843/v3.0.12025-02-17T16:01:59Zv3.0.1<h3>Bug fixes</h3>
<ul>
<li><strong>Separate ESM and UMD type definitions</strong> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/dcodeIO/bcrypt.js/commit/e7055caf0c723cbcf8bc3f0784b8c30ee332380f/hovercard" href="https://github.com/dcodeIO/bcrypt.js/commit/e7055caf0c723cbcf8bc3f0784b8c30ee332380f"><tt>e7055ca</tt></a>)</li>
</ul>github-actions[bot]tag:github.com,2008:Repository/9784843/v3.0.02025-02-13T18:54:03Zv3.0.0<h3>Breaking changes</h3>
<ul>
<li><strong>Modernize project structure</strong> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/dcodeIO/bcrypt.js/commit/2f45985738604c743c4b8cc8464e3e7d3e04c73d/hovercard" href="https://github.com/dcodeIO/bcrypt.js/commit/2f45985738604c743c4b8cc8464e3e7d3e04c73d"><tt>2f45985</tt></a>)<br>
The project now exports an ECMAScript module by default, albeit with an UMD fallback, ships with types, the dist/ directory no longer exists in version control, and Closure Compiler externs have been removed.</li>
<li><strong>Generate 2b hashes by default</strong> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/dcodeIO/bcrypt.js/commit/d36bfb42fa642b6d6986a84ce106a7110e5824db/hovercard" href="https://github.com/dcodeIO/bcrypt.js/commit/d36bfb42fa642b6d6986a84ce106a7110e5824db"><tt>d36bfb4</tt></a>)<br>
This library was not affected by the bug that led to incrementing the bcrypt version from 2a to 2b, but nowadays most implementations use 2b, including the native bcrypt binding, so this change aligns with them. Existing hashes will continue to work, but test logic that generates hashes and compares them literally might need to be updated to account for the new default.</li>
</ul>
<h3>Features</h3>
<ul>
<li><strong>Add helper to check for password input length</strong> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/dcodeIO/bcrypt.js/commit/d5656b39e2e368c87724a312e4e454456a4e5d1b/hovercard" href="https://github.com/dcodeIO/bcrypt.js/commit/d5656b39e2e368c87724a312e4e454456a4e5d1b"><tt>d5656b3</tt></a>)</li>
</ul>
<h3>Other</h3>
<ul>
<li><strong>Update publish workflow</strong> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/dcodeIO/bcrypt.js/commit/2a9bea9e276e6be04dbd403f9695937788b3b10a/hovercard" href="https://github.com/dcodeIO/bcrypt.js/commit/2a9bea9e276e6be04dbd403f9695937788b3b10a"><tt>2a9bea9</tt></a>)</li>
<li><strong>Add note on using the ESM variant in the browser</strong> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/dcodeIO/bcrypt.js/commit/e09eb9afb14170069aaea19631b763307ee7b480/hovercard" href="https://github.com/dcodeIO/bcrypt.js/commit/e09eb9afb14170069aaea19631b763307ee7b480"><tt>e09eb9a</tt></a>)</li>
<li><strong>Update types</strong> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/dcodeIO/bcrypt.js/commit/58333a1533dd53838e2697628f84b98d54a5c079/hovercard" href="https://github.com/dcodeIO/bcrypt.js/commit/58333a1533dd53838e2697628f84b98d54a5c079"><tt>58333a1</tt></a>)</li>
<li><strong>Merge lint and test workflows</strong> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/dcodeIO/bcrypt.js/commit/2e3b17659e8856696acfe3015631ce2989eb3084/hovercard" href="https://github.com/dcodeIO/bcrypt.js/commit/2e3b17659e8856696acfe3015631ce2989eb3084"><tt>2e3b176</tt></a>)</li>
<li><strong>Fix tests</strong> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/dcodeIO/bcrypt.js/commit/ec02e8a0ada7a8f6c71a91df164db8c25bbbb7b4/hovercard" href="https://github.com/dcodeIO/bcrypt.js/commit/ec02e8a0ada7a8f6c71a91df164db8c25bbbb7b4"><tt>ec02e8a</tt></a>)</li>
<li><strong>Update legacy fallback to handle crypto dependency</strong> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/dcodeIO/bcrypt.js/commit/9db275fa10b1b40da4a6844480d7f8ae8df27fb8/hovercard" href="https://github.com/dcodeIO/bcrypt.js/commit/9db275fa10b1b40da4a6844480d7f8ae8df27fb8"><tt>9db275f</tt></a>)</li>
<li><strong>Update lint workflow title</strong> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/dcodeIO/bcrypt.js/commit/ac70ac57c2f99ad5639eddf54578e5fdd07b9c4c/hovercard" href="https://github.com/dcodeIO/bcrypt.js/commit/ac70ac57c2f99ad5639eddf54578e5fdd07b9c4c"><tt>ac70ac5</tt></a>)</li>
<li><strong>Adapt crypto module usage for ESM environments</strong> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/dcodeIO/bcrypt.js/commit/574d690d4972bcebbd5ca07880a62abab9ae3c0b/hovercard" href="https://github.com/dcodeIO/bcrypt.js/commit/574d690d4972bcebbd5ca07880a62abab9ae3c0b"><tt>574d690</tt></a>)</li>
<li><strong>Format with prettier</strong> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/dcodeIO/bcrypt.js/commit/e7465479282d8155852ce88d6407eccb14adc106/hovercard" href="https://github.com/dcodeIO/bcrypt.js/commit/e7465479282d8155852ce88d6407eccb14adc106"><tt>e746547</tt></a>)</li>
<li><strong>Rename default branch to 'main'</strong> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/dcodeIO/bcrypt.js/commit/548559d032d7dd5ac3e4e16d7afd87b36ebe96ca/hovercard" href="https://github.com/dcodeIO/bcrypt.js/commit/548559d032d7dd5ac3e4e16d7afd87b36ebe96ca"><tt>548559d</tt></a>)</li>
<li><strong>Update description to mention TypeScript support</strong> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/dcodeIO/bcrypt.js/commit/4977df0849eaf8cad5b0d0b543fe452432a2d761/hovercard" href="https://github.com/dcodeIO/bcrypt.js/commit/4977df0849eaf8cad5b0d0b543fe452432a2d761"><tt>4977df0</tt></a>)</li>
<li><strong>Add stale action for issues and PRs</strong> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/dcodeIO/bcrypt.js/commit/a84d4e45487df0972d8781feafa477d5db4c1dbd/hovercard" href="https://github.com/dcodeIO/bcrypt.js/commit/a84d4e45487df0972d8781feafa477d5db4c1dbd"><tt>a84d4e4</tt></a>)</li>
<li><strong>Fix typo</strong> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/dcodeIO/bcrypt.js/commit/c8c9c01799bbc13092fcbb20cfab4d9015d14c61/hovercard" href="https://github.com/dcodeIO/bcrypt.js/commit/c8c9c01799bbc13092fcbb20cfab4d9015d14c61"><tt>c8c9c01</tt></a>)</li>
<li><strong>Fix Node.js version in CI</strong> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/dcodeIO/bcrypt.js/commit/1b54cc48d4120b50e1d9058e5a67f326102fd744/hovercard" href="https://github.com/dcodeIO/bcrypt.js/commit/1b54cc48d4120b50e1d9058e5a67f326102fd744"><tt>1b54cc4</tt></a>)</li>
</ul>
<h3>Backlog from v2</h3>
<ul>
<li><strong>Added externs to .npmignore (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="713252407" data-permission-text="Title is private" data-url="https://github.com/dcodeIO/bcrypt.js/issues/124" data-hovercard-type="pull_request" data-hovercard-url="/dcodeIO/bcrypt.js/pull/124/hovercard" href="https://github.com/dcodeIO/bcrypt.js/pull/124">#124</a>)</strong> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/dcodeIO/bcrypt.js/commit/7e2e93af99df2952253f9cf32db29aefa8f272f7/hovercard" href="https://github.com/dcodeIO/bcrypt.js/commit/7e2e93af99df2952253f9cf32db29aefa8f272f7"><tt>7e2e93a</tt></a>)<br>
The npm package does not need externs as it is needed only for closure compiler. Added it in .npmignore since bcryptjs overrides global module and process in WebStorm IDE.</li>
<li><strong>Make sure the bin script uses LF</strong> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/dcodeIO/bcrypt.js/commit/684fac6814a81d974c805a15e22fd69922c7ca6e/hovercard" href="https://github.com/dcodeIO/bcrypt.js/commit/684fac6814a81d974c805a15e22fd69922c7ca6e"><tt>684fac6</tt></a>)</li>
<li><strong>Post-merge; Clean up a bit</strong> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/dcodeIO/bcrypt.js/commit/b09f7f266a7015456b7b36deeb026dc636f64542/hovercard" href="https://github.com/dcodeIO/bcrypt.js/commit/b09f7f266a7015456b7b36deeb026dc636f64542"><tt>b09f7f2</tt></a>)</li>
<li><strong>Improve safeStringCompare using xor (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="277783995" data-permission-text="Title is private" data-url="https://github.com/dcodeIO/bcrypt.js/issues/77" data-hovercard-type="pull_request" data-hovercard-url="/dcodeIO/bcrypt.js/pull/77/hovercard" href="https://github.com/dcodeIO/bcrypt.js/pull/77">#77</a>)</strong> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/dcodeIO/bcrypt.js/commit/648482a5395bef074ad34e52759fede957a89397/hovercard" href="https://github.com/dcodeIO/bcrypt.js/commit/648482a5395bef074ad34e52759fede957a89397"><tt>648482a</tt></a>)</li>
<li><strong>Added bin entry</strong> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/dcodeIO/bcrypt.js/commit/49a1d1ab46d22ac02659cb787ded08d644f79cb5/hovercard" href="https://github.com/dcodeIO/bcrypt.js/commit/49a1d1ab46d22ac02659cb787ded08d644f79cb5"><tt>49a1d1a</tt></a>)</li>
</ul>github-actions[bot]tag:github.com,2008:Repository/9784843/2.4.32025-02-13T18:37:34Zv2.4.3<p>Last v2 before restructuring the project to export an ECMAScript module by default.</p>dcodeIOtag:github.com,2008:Repository/9784843/2.4.22017-02-07T08:02:06Z2.4.2<p>Switched CC to use simple optimizations, also fixes <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="203885462" data-permission-text="Title is private" data-url="https://github.com/dcodeIO/bcrypt.js/issues/55" data-hovercard-type="issue" data-hovercard-url="/dcodeIO/bcrypt.js/issues/55/hovercard" href="https://github.com/dcodeIO/bcrypt.js/issues/55">#55</a></p>dcodeIOtag:github.com,2008:Repository/9784843/2.4.02018-03-05T21:35:59Z2.4.0<p>Merge pull request <a class="issue-link js-issue-link" href="https://github.com/dcodeIO/bcrypt.js/pull/48">#48</a> from JakobLofgren/master</p>
<p>Add Promise example in Async code examples</p>dcodeIOtag:github.com,2008:Repository/9784843/2.3.02015-09-23T15:18:02Z2.3.0<p>Test for WCA on self instead of window for webworker compatibility, s…</p>dcodeIOtag:github.com,2008:Repository/9784843/2.2.22015-09-19T00:42:16Z2.2.2<p>Use constant time string compare, fixes <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="106809038" data-permission-text="Title is private" data-url="https://github.com/dcodeIO/bcrypt.js/issues/29" data-hovercard-type="issue" data-hovercard-url="/dcodeIO/bcrypt.js/issues/29/hovercard" href="https://github.com/dcodeIO/bcrypt.js/issues/29">#29</a></p>dcodeIOtag:github.com,2008:Repository/9784843/2.2.12015-08-02T21:15:35Z2.2.1<p>Prevent integer wrap-around with 31 rounds, fixes <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="98410676" data-permission-text="Title is private" data-url="https://github.com/dcodeIO/bcrypt.js/issues/24" data-hovercard-type="pull_request" data-hovercard-url="/dcodeIO/bcrypt.js/pull/24/hovercard" href="https://github.com/dcodeIO/bcrypt.js/pull/24">#24</a>, fixes <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="98547551" data-permission-text="Title is private" data-url="https://github.com/dcodeIO/bcrypt.js/issues/25" data-hovercard-type="issue" data-hovercard-url="/dcodeIO/bcrypt.js/issues/25/hovercard" href="https://github.com/dcodeIO/bcrypt.js/issues/25">#25</a></p>dcodeIO