I have a strange situation figured out, when the Hashbyte
function of SQL Server is not outputting the correct result when converting it to SHA2_256
with a string containing umlauts (ä,ö,ü,ß).
I run the example code in SQL Server:
declare @cryptString varchar(50)
set @cryptString = 'test'
select convert(Varchar(64), Hashbytes('SHA2_256', @cryptstring), 2)
The result is:
9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08
When I'm checking the SHA256 conversion on https://hashgenerator.de/ the result is the same.
My problem: when I'm trying to crypt for example 'müller', the result in SQL Server is:
26A45113433596C5DD53643C7652381202E8009E532A280E513D887174A9ED14
When I'm checking the SHA256 conversion on https://hashgenerator.de/ the result is different.
2dbd218072117713f2d5996a726a9b216ed791ffd0783b6ba4ab6d61b8333192
I think it could be a encoding problem, but I searched for hours and can't find any clue to solve this problem.
I appreciate any kind of help to solve this problem.