You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
TrustPilotChallenge/dotnet/WhiteRabbit/MD5Digest.cs

25 lines
692 B

namespace WhiteRabbit
8 years ago
{
using System.Runtime.CompilerServices;
using WhiteRabbitUnmanagedBridge;
internal static class MD5Digest
{
// It only returns first component of MD5 hash
8 years ago
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe uint[] Compute(PhraseSet input)
{
var result = new uint[Constants.PhrasesPerSet];
fixed (uint* resultPointer = result)
{
fixed (long* inputBuffer = input.Buffer)
{
MD5Unmanaged.ComputeMD5((uint*)inputBuffer, resultPointer);
}
}
return result;
}
}
}