Creating a unique hash code (string) in SQL Server from a combination of two or more columns (different data types)

I would like to create unique string columns (32 characters long) from a combination of columns with different data types in SQL Server 2005.

+3
source share
2 answers

I found a solution elsewhere in StackOverflow

SELECT SUBSTRING(master.dbo.fn_varbintohexstr(HashBytes('MD5', 'HelloWorld')), 3, 32)

Answer thread here

+4
source

With HASBYTESyou can create SHA1 hashes that have 20 bytes, and you can create MD5 hashes, 16 bytes. There are various combined algorithms that can create arbitrary length material using repetitive hash operations, such as PRF TLS (see RFC 2246 ).

, . , "32 ", - , . , , ( "" ). 32 ( , "" ) 50% 4 10 38 (. ), - 32 , .

+2

Source: https://habr.com/ru/post/1795398/


All Articles