This function generates a hash value from a text string
str : The text string, or array with text strings.
hash : The hash value, integer value between 0 and 2^32-1
type : Type of has 'djb2' (default) or 'sdbm'
From c-code on : http://www.cse.yorku.ca/~oz/hash.html
this algorithm was first reported by dan bernstein many years ago
this algorithm was created for sdbm (a public-domain reimplementation of
ndbm) database library. it was found to do well in scrambling bits,
causing better distribution of the keys and fewer splits. it also happens
to be a good general hashing function with good distribution.
Dirk-Jan Kroon (2020). String2Hash (https://www.mathworks.com/matlabcentral/fileexchange/27940-string2hash), MATLAB Central File Exchange. Retrieved .
@Olaf Bousche (and anyone else who may be interested) yes you are correct. 2^32-1 should be 2^32 for sdbm
Nice idea. SDBM is pretty good. I looked at the code: Since you are emulating c-code uint32, should you not be using