LMSouq
database Open

What column type/length should I use for storing a Bcrypt hashed password in a Database?

HE
helpermethod
1 month ago
3 views
Problem Description
I want to store a hashed password (using BCrypt) in a database. What would be a good type for this, and which would be the correct length? Are passwords hashed with BCrypt always of same length? **EDIT** Example hash: $2a$10$KssILxWNR6k62B7yiX0GAe2Q7wwHlrzhF3LqtVvpyvHZf0MwvNfVu After hashing some passwords, it seems that BCrypt always generates `60` character hashes. **EDIT 2** Sorry for not mentioning the implementation. I am using [jBCrypt][1]. [1]: http://www.mindrot.org/projects/jBCrypt/

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base