Home
funnn `crypto.pbkdf2` just randomly returns some gibberish instead of a real result, while `deriveBits` works correctly every time. ```log pbkdf2(a8b841c8dbbbaae2ecb53851aa577be41b805e03c02e6ef1db200c0884df1439, a53001962360393006d081ca77608b3fc984fcb8f231b29e2a55da4c92df39585dc7173c98a61a8c, 100000, 64, sha512) node crypto result: e760cb6df317d349d29c42f7a49d1939296339434831c825c1f8dda392edeb5d8912650059e7d5560081544fe0afe40fed5215fd7b7054cf2166abcc5ce87316 subtle crypto result: c034cfb2e1c48945ad062b93b5725b0722a50d33680dd6526bccae2b95a6adee9b020c7be3e47c734e471ccf2516c895d04aa74b9ddffca1e2e1fd7e02a90236 ``` and it turned out bun doesn't even implement node's crypto on its own! it uses [crypto-browserify](https://npm.im/crypto-browserify), which haven't been updated in **6 YEARS** ([src](https://github.com/oven-sh/bun/blob/main/src/node-fallbacks/crypto.js)). and yes, it's **slow as shit** (like, noticably slow, there's even an [issue about this](https://github.com/oven-sh/bun/issues/883)) i can't even get a proper minimal repro, since it works fine *sometimes*, and i don't care enough to debug this further, since the issue is probably in the underlying library which likely won't even be updated anytime soon. fucking hell. blazing fast my ass