TSQL md5 hash different to C# .NET md5

前端 未结 4 862
旧时难觅i
旧时难觅i 2020-11-29 09:15

I\'ve generated an md5 hash as below:

DECLARE @varchar varchar(400) 

SET @varchar = \'è\'

SELECT CONVERT(VARCHAR(2000), HASHBYTES( \'MD5\', @varchar ), 2)
         


        
4条回答
  •  渐次进展
    2020-11-29 09:51

    sql server hashbytes allways works like System.Text.Encoding.Unicode on unicode characters like arabic persian ,... if you use Utf8.Unicode Or Ascii.Unicode You will see the diffrence and if you use Utf8.Unicode the return result of sql server and c# will be same

提交回复
热议问题