Storing hexadecimal values as binary in MySQL

后端 未结 6 953
情话喂你
情话喂你 2020-12-15 08:42

I was thinking about how I\'m storing passwords in my database : appropriately salted SHA1 strings in a CHAR(40) field. However, since the character data in there is actuall

6条回答
  •  一个人的身影
    2020-12-15 08:58

    Why reinvent the wheel? Why not use CHAR(41) like table `mysql.user' uses? It's a well-known format, so any future maintainers won't be scratching their heads over your special scheme? Make it easy on everyone by just noting "just like MySQL passwords."

提交回复
热议问题