WstHash.GetHash Method (Int64, Int32)

[This is internal Microsoft documentation - Do not distribute.]

Static method to get hash value of a large integer key

Namespace: Microsoft.Webstore.WstClient
Assembly: ICL (in icl.dll)

Syntax

'Declaration

  Public Shared Function GetHash ( _
    largeKey As Long, _
    maxHash As Integer _
) As Integer
  public static int GetHash (
    long largeKey,
    int maxHash
)

Parameters

  • largeKey
    large integer key
  • maxHash
    Max Hash

Return Value

0..maxHash-1

Remarks

The unmanaged webstore client library implementation of HashLARGEINTEGER iterates through each byte of the LARGEINTEGER as follows: LARGE_INTEGER li; unsigned char rgby[sizeof(unsigned long)*2] = {0}; memcpy((addr)rgby[0], (addr)(li.HighPart), sizeof(unsigned long)); memcpy((addr)rgby[sizeof(unsigned long)], (addr)(li.LowPart), sizeof(unsigned long)); li.QuadPart = 0x8877665544332211 li.HighPart = 0x88776655 li.LowPart = 0x44332211 rgby[0] = 0x55 rgby[1] = 0x66 rgby[2] = 0x77 rgby[3] = 0x88 rgby[4] = 0x11 rgby[5] = 0x22 rgby[6] = 0x33 rgby[7] = 0x44 So, for us to calculate the same hash values for our int64, we will need to process high dword then low dword also.

Thread Safety

All public static (Shared in Visual Basic) members of this type are thread-safe. Instance members are not guaranteed to be thread-safe.

Platforms

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition

Target Platforms

See Also

Reference

WstHash Class
WstHash Members
Microsoft.Webstore.WstClient Namespace