Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bycrpt versions in the docs don't match with the ones in the code #201

Open
Realtin opened this issue Mar 18, 2025 · 1 comment
Open

bycrpt versions in the docs don't match with the ones in the code #201

Realtin opened this issue Mar 18, 2025 · 1 comment

Comments

@Realtin
Copy link

Realtin commented Mar 18, 2025

Hello,

I was setting up bcrypt in my adonis v6 app and the example and explanation in the doc:
https://github.com/adonisjs/v6-docs/blob/main/content/docs/security/hashing.md#bcrypt
will have typescript complain. In the BcryptConfig it is defined as version?: 0x61 | 0x62; which translates to 97 and 98 instead of '2a' and '2b' as described in the docs.

From the docs:

export default defineConfig({
  // Make sure to update the default driver to bcrypt
  default: 'bcrypt',

  list: {
    bcrypt: drivers.bcrypt({
      rounds: 10,
      saltSize: 16,
      version: '2b'
    })
  }
})
version

The version for the hashing algorithm. The supported values are 2a and 2b. Using the latest version, i.e., 2b is recommended.

@thetutlage
Copy link
Member

That seems to be an issue within the docs. It should be this https://github.com/adonisjs/hash/blob/9.x/src/types.ts#L138C13-L138C24

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

No branches or pull requests

2 participants