HashBytes is a T-SQL function, used to encrypt the input value by using the algorithm MD2, MD5, MD5, SHA or SHA1. This T-SQL function is available from SQL 2005.
HashBytes accepts two parameters, one is Name of the algorithm, and other is input value either direct value or @variable. Variable accepts, if belongs to varchar, nvarchar, or varbinary Datatypes
HashBytes ( '
Refer this link, to know about these algorithms
Sample Query with HashBytes:
DECLARE @Value1 VARBINARY(150)
SET @Value1 = HashBytes('MD5', 'Value1')
SELECT @Value1 as HashValue
Output of this Query: