A helper class to map key (number hashes) to existing or yet to be added strings
More...
|
| StringHasher (int reserved32) |
|
| StringHasher (ulong reservedU64) |
|
| StringHasher (int reserved32, ulong reservedU64) |
|
virtual int | GetAndSet32 (int desiredHashKey, string value, bool checkValue=true) |
| Returns the hash value for the given string value , either an existing one or a new one using the stringHashDictInt32 More...
|
|
virtual ulong | GetAndSetU64 (ulong desiredHashKey, string value, bool checkValue=true) |
| Returns the hash value for the given string value , either an existing one or a new one using the stringHashDictUInt64 More...
|
|
|
Dictionary< int, string > | stringHashDictInt32 = new Dictionary<int, string>() |
|
Dictionary< ulong, string > | stringHashDictUInt64 = new Dictionary<ulong, string>() |
|
int | reserved32 = -1 |
|
ulong | reservedU64 = 0 |
|
A helper class to map key (number hashes) to existing or yet to be added strings
◆ GetAndSet32()
virtual int NikosAssets.Helpers.StringHasher.GetAndSet32 |
( |
int |
desiredHashKey, |
|
|
string |
value, |
|
|
bool |
checkValue = true |
|
) |
| |
|
virtual |
Returns the hash value for the given string value , either an existing one or a new one using the stringHashDictInt32
- Parameters
-
desiredHashKey | The desired hash for the given string value |
value | The string value to map to the generated or desired hash |
checkValue | Check if the value already has a key that doesnt match the desiredKey? /// |
- Returns
- Returns the reserved number, if the string value is null or empty. Returns the desiredHash value if the string entry matched the hash or no entry was found. Returns a new random hash value if the string value did not match the desired key on the found entry (hash collision) or the desired hash matched the reserved number
◆ GetAndSetU64()
virtual ulong NikosAssets.Helpers.StringHasher.GetAndSetU64 |
( |
ulong |
desiredHashKey, |
|
|
string |
value, |
|
|
bool |
checkValue = true |
|
) |
| |
|
virtual |
Returns the hash value for the given string value , either an existing one or a new one using the stringHashDictUInt64
- Parameters
-
desiredHashKey | The desired hash for the given string value |
value | The string value to map to the generated or desired hash |
checkValue | Check if the value already has a key that doesnt match the desiredKey? |
- Returns
- Returns the reserved number, if the string value is null or empty. Returns the desiredHash value if the string entry matched the hash or no entry was found. Returns a new random hash value if the string value did not match the desired key on the found entry (hash collision) or the desired hash matched the reserved number