In SQL you can use the HASHBYTES function to generate the hash of an input, the output is the binary represention of the hash. If you want to get this as a unicode value then you can use the below code.

SELECT LOWER(CONVERT(VARCHAR(255),HASHBYTES('sha2_256','abc'),2));

This gives a result of ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad which can be confirmed here.


Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *