2021-05-14: y_stringhash Hash Algorithm
You can change which hash function is used by y_stringhash:
You would only need this in the extremely rare event that you get a hash collision between two cases. It is also important to note that these are NOT cryptographic hashes - they are use to compare simple string, NOT to store passwords.
You can change which hash function is used by y_stringhash:
- Bernstein (Default):
Quote:
switch (YHash(input))
{
____case __H<hello>: {}
____case __H<world>: {}
}
- Bernstein (Explicit):
Quote:
switch (YHash(input, .type = hash_bernstein))
{
____case __H@b<hello>: {}
____case __H@b<world>: {}
}
- FNV1:
Quote:
switch (YHash(input, .type = hash_fnv1))
{
____case __H@f<hello>: {}
____case __H@f<world>: {}
}
- FNV1a:
Quote:
switch (YHash(input, .type = hash_fnv1a))
{
____case __H@a<hello>: {}
____case __H@a<world>: {}
}
You would only need this in the extremely rare event that you get a hash collision between two cases. It is also important to note that these are NOT cryptographic hashes - they are use to compare simple string, NOT to store passwords.