HashString

Computes the MD5, RIPEMD160, SHA1, SHA256, SHA384, or SHA512 hash of a string input in SQL Server without an 8000 bytes limitation

  • Free Function
  • SQL Server Compatibility: 2008, 2012, 2014, 2016, 2017

Syntax:

SELECT SQLHTTP.net.HashString ( @Algorithm, @StringToHash )

Arguments:

Name Type Description
@Algorithm varchar(20) One of the following Algorithm: MD5, RIPEMD160, SHA1, SHA256, SHA384, or SHA512
@StringToHash varchar(MAX) String data to hash

Return Type:

varbinary(MAX)

Remarks:

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

Sample Usage:

See Also: