Show all Hide all


Computes the hash of its input. Unlike the builtin HASHBYTES it can work on data longer than 8000 bytes and supports modern algorithms.

Type: Scalar function
Area of use: General use


@algorithm mandatory varchar(10)
What algorithm to use to compute the hash
Possible value Description
md5 Returns a binary(16) hash
sha1 Returns a binary(20) hash
sha256 Returns a binary(32) hash
sha512 Returns a binary(64) hash
@bytes mandatory varbinary(max)
Data to compute hash for