2
C#에서 Rails 웹 앱을 다시 작성하고 있습니다. 난 정말 루비의 해시 함수와 함께 붙어있어 :루비의 SHA512.hexdigest를 C#으로 변환하는 방법?
private static string Hash(string password, string salt)
{
return BitConverter.ToString(new SHA512CryptoServiceProvider().ComputeHash(Encoding.UTF8.GetBytes(password + ":" + salt))).Replace("-", "").ToLower();
}
내가 잘못 뭐하는 거지 :
# Generates a 128 character hash
def Password.hash(password,salt)
Digest::SHA512.hexdigest("#{password}:#{salt}")
end
다음 C# 함수는 다른 결과를 준다?
고맙습니다.
각각의 경우 결과는 어떻게됩니까? 루비는 실제로 UTF-8을 사용합니까? –