I am currently building a login process and decided to store my user password in database with a hashpassword combined with a salt. Just wondering what datatypes to store the hashpassword and salt is Varchar or NVarchar sufficient ?
我目前正在构建一个登录过程,并决定将用户密码与hashpassword和salt结合存储在数据库中。只是想知道存储hashpassword和salt的数据类型是Varchar还是NVarchar就足够了?
EDIT : Link where I am basing this on storing passwords in SQL Server
编辑:在SQL Server中存储密码的链接
3 个解决方案
#1
2
The hash of your passwords should be of uniform string length and represented as either hex or base64 text (or some other, single-byte-per-character representation.)
密码的哈希值应该是一致的字符串长度,并表示为十六进制或base64文本(或者其他的,每个字符的单字节表示)。
EDIT (You just need the char type per the uniform length of hash output!)
编辑(您只需要按哈希输出的一致长度使用char类型!)
So char will suffice.
所以char就足够了。
#2
4
Microsoft use Nvarchar
in when we use SQL membership, have a look the below image
微软使用Nvarchar在我们使用SQL会员时,请看下面的图片
#3
0
use the varchar
datatype
使用varchar数据类型
-- blah blah blah --
等等等等。
I need 30 characters to post a reply
我需要30个字符来回复
#1
2
The hash of your passwords should be of uniform string length and represented as either hex or base64 text (or some other, single-byte-per-character representation.)
密码的哈希值应该是一致的字符串长度,并表示为十六进制或base64文本(或者其他的,每个字符的单字节表示)。
EDIT (You just need the char type per the uniform length of hash output!)
编辑(您只需要按哈希输出的一致长度使用char类型!)
So char will suffice.
所以char就足够了。
#2
4
Microsoft use Nvarchar
in when we use SQL membership, have a look the below image
微软使用Nvarchar在我们使用SQL会员时,请看下面的图片
#3
0
use the varchar
datatype
使用varchar数据类型
-- blah blah blah --
等等等等。
I need 30 characters to post a reply
我需要30个字符来回复