I’m going to run SHA256 on a password + salt, but I don’t know how long to make my VARCHAR when setting up the MySQL database. What is a good length?
I’m going to run SHA256 on a password + salt, but I don’t know
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A sha256 is 256 bits long — as its name indicates.
Since sha256 returns a hexadecimal representation, 4 bits are enough to encode each character (instead of 8, like for ASCII), so 256 bits would represent 64 hex characters, therefore you need a
varchar(64), or even achar(64), as the length is always the same, not varying at all.And the demo :
Will give you :
i.e. a string with 64 characters.