HASHBYTES( 'md5', 'demo' )this results in a varbinary value of: 0xFE01CE2A7FBAC8FAFAED7C982A04E229.
use the convert function to make this a readable string:
CONVERT(VARCHAR(MAX), HASHBYTES( 'md5', 'demo' ), 2)for style make it a lowercase using the lower function:
LOWER(CONVERT(VARCHAR(MAX), HASHBYTES( 'md5', 'demo' ), 2))+1 for SQL Server
Luuk
Please note that the function needs VARCHAR types, not NVARCHAR (unicode). This will generate a different hash.
ReplyDelete