Код: Выделить всё
using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;
public class Program
{
public static void Main()
{
string profileId = "TEST";
using (MD5 md5 = MD5.Create())
{
string playerGroup;
byte[] inputBytes = Encoding.UTF8.GetBytes(profileId);
byte[] hashBytes = md5.ComputeHash(inputBytes);
long hashCode = BitConverter.ToInt64(hashBytes, 0);
Console.WriteLine(hashCode);
}
}
}
Я хочу воспроизвести тот же процесс в SQL (Amazone Redshift).
Но получаю другой результат.
Если да:
Код: Выделить всё
select from_hex(substring(md5('TEST'), 1, 16))::bigint
Есть ли способ воспроизвести процесс C# на SQL (Redshift)?
Я пробовал:
Код: Выделить всё
select from_hex(substring(md5('TEST'), 1, 16))::bigint
Получаю: 233018722177570788
Подробнее здесь: https://stackoverflow.com/questions/791 ... n-redshift
Мобильная версия