What data type to use for hashed password field and what length?

后端 未结 10 1927
孤街浪徒
孤街浪徒 2020-11-22 15:47

I\'m not sure how password hashing works (will be implementing it later), but need to create database schema now.

I\'m thinking of limiting passwords to 4-20 charact

10条回答
  •  时光取名叫无心
    2020-11-22 16:08

    It really depends on the hashing algorithm you're using. The length of the password has little to do with the length of the hash, if I remember correctly. Look up the specs on the hashing algorithm you are using, run a few tests, and truncate just above that.

提交回复
热议问题