[GH-ISSUE #150] Q: Why is it not Node-independent? #8149

Closed
opened 2026-04-13 03:13:48 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @k-kozika on GitHub (Oct 12, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/150

Here is an import that uses node:
Why is Scrypt encryption possible using Oslo or @noble/hashes but they are not used?

Originally created by @k-kozika on GitHub (Oct 12, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/150 [Here](https://github.com/better-auth/better-auth/blob/dfbcbdf5acecee388c8cf60acdadf8228a0e91ad/packages/better-auth/src/crypto/password.ts#L1) is an import that uses `node:` Why is Scrypt encryption possible using [`Oslo`](https://oslo.js.org/reference/password/Scrypt/) or [`@noble/hashes`](https://github.com/paulmillr/noble-hashes?tab=readme-ov-file#scrypt) but they are not used?
GiteaMirror added the locked label 2026-04-13 03:13:48 -05:00
Author
Owner

@Bekacru commented on GitHub (Oct 12, 2024):

Our implementation is similar to Oslo's, which also uses "node:crypto." But, because Oslo uses classes, we ran into an issue where the generateKey method lost its reference after passing through our init context. Since "node:crypto" is already supported by multiple runtimes, we opted to continue using it rather than switching to @noble/hashes, even though noble doesn't rely on Node's implementation.

<!-- gh-comment-id:2408460663 --> @Bekacru commented on GitHub (Oct 12, 2024): Our implementation is similar to Oslo's, which also uses "node:crypto." But, because Oslo uses classes, we ran into an issue where the `generateKey` method lost its reference after passing through our init context. Since "node:crypto" is already supported by multiple runtimes, we opted to continue using it rather than switching to `@noble/hashes`, even though noble doesn't rely on Node's implementation.
Author
Owner

@k-kozika commented on GitHub (Oct 12, 2024):

I see.

<!-- gh-comment-id:2408477692 --> @k-kozika commented on GitHub (Oct 12, 2024): I see.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#8149