HashData (shlwapi)
Last changed: anonymous

.
Summary
Hashes an array of data.

C# Signature:

[DllImport("Shlwapi.dll", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = false)]
   internal static extern int HashData(
    [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 1)]
    byte[] pbData,
    int cbData,
    [Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 3)]
    byte[] piet,
   int outputLen);

User-Defined Types:

None.

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

public static uint hash(string pStr)
    {
        if (string.IsNullOrEmpty(pStr))
        {
        throw new ArgumentException("cannot calculate on null", "pStr");
        }
        //utf8
        byte[] enc = Encoding.GetEncoding(1200).GetBytes(pStr);

        byte[] outpHash = { 0, 0, 0, 0 };
        HashData(enc, enc.Length, outpHash, 4);
        return BitConverter.ToUInt32(outpHash, 0);
    }

Documentation