Public Function HashString( _ ByVal vValue As Variant _ , Optional ByVal vRangePrimeNumber As Variant _ ) As Variant
HashString("Hello") = 14802676 HashString("Hello", 4093) = 83 HashString("World") = 10825270 HashString("World", 4093) = 1445See also:
HashStringFast Function HashTable Class MetaPhone Function Soundex Function PreviousPrime Function IsPrime FunctionSummary: Given the same string (in vValue) and vRangePrimeNumber, this function will always return the same "hash" value. The number of strings with the same hash value depends upon the value of vRangePrimeNumber and the number of strings that are "hashed." If the number of (unique) strings hashed exceeds vRangePrimeNumber, then there will definitely be duplicate hash values generated.
vValue: The string which is to be "hashed." Function returns Null if vValue is Null or cannot be fixed up to a String.
vRangePrimeNumber: Number which determines the range of values returned from the hash operation. vRangePrimeNumber defaults to 16,777,213 (a suitably large prime number) when it is missing or Null or cannot be interpreted as a number. vRangePrimeNumber should be a positive, prime number.
Returns the hash value as a double-precision floating-point number (a Double) that will be an integer.
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.