SARC: Difference between revisions

imported>Leoetlino
imported>Leoetlino
Line 5: Line 5:


=== Hash algorithm ===
=== Hash algorithm ===
The algorithm given on the MK8 wiki is not fully correct: it fails to account for the fact that Nintendo's algorithm uses an unsigned 32-bit integer for the hash variable, and a '''''signed'' char variable'''.
The algorithm given on the MK8 wiki is not fully correct: it fails to account for the fact that Nintendo's algorithm uses an unsigned 32-bit integer for the hash variable, and a '''''signed'' char variable'''. It is also misleading in that Nintendo iterates over each byte, not each string character.


Here is an accurate implementation of the algorithm, written in C++:
Here is an accurate implementation of the algorithm, written in C++:
Anonymous user