Will a SHA256 hash always have 64 characters?

萝らか妹 提交于 2019-12-06 16:36:35

问题


I'm setting up my database to receive hashed passwords and not accept plain text.

Would I go something like this?

create table User(
username varchar(20) not null,
password varchar(64) not null,
);

回答1:


Yes, a SHA256 is always 256 bits long, equivalent to 32 bytes, or 64 bytes in an hexadecimal string format. You can even use char(64) instead of varchar(64) since the size won't change.




回答2:


Yes, it will always have 64 characters.



来源:https://stackoverflow.com/questions/3064133/will-a-sha256-hash-always-have-64-characters

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!