HashUnicode
Computes the MD5, RIPEMD160, SHA1, SHA256, SHA384, or SHA512 hash of a unicode string input in SQL Server without an 8000 bytes limitation
- Free Function
- SQL Server Compatibility: 2008, 2012, 2014, 2016, 2017
SELECT SQLHTTP.net.HashString ( @Algorithm, @UnicodeToHash )
Name | Type | Description |
---|---|---|
@Algorithm | varchar(20) | One of the following Algorithm: MD5, RIPEMD160, SHA1, SHA256, SHA384, or SHA512 |
@UnicodeToHash | nvarchar(MAX) | Unicode string data to hash |
varbinary(MAX)
This function is similar to the Microsoft’s HashBytes SQL Server function, but with slightly different algorithms and without the 8000 bytes limitation. We provide three distinct functions: HashBinary, HashString, and HashUnicode
1 2 3 4 5 6 7 8 9 10 |
DECLARE @Algorithm varchar(20) DECLARE @UnicodeToHash nvarchar(MAX) SET @Algorithm = 'SHA512' SET @UnicodeToHash = N'The quick brown fox jumps over the lazy dog' SELECT SQLHTTP.net.HashUnicode(@Algorithm, @UnicodeToHash) |
1 2 3 4 |
------------------------------------------------------------------ 0x568A357630E3113C3932290749F4323EACEE0C46CA02189C52D168ED35E0FEEAA79E1A7AE725991DF6E7D5E5C8F0877B8F51AB244BA7BDE173033AD4DE7C36DE |