SARC: Difference between revisions

38 bytes removed ,  3 years ago
(→‎Hash algorithm: replace the code snippet with the sead implementation and add more information about the s8 cast)
Line 5: Line 5:


=== Hash algorithm ===
=== Hash algorithm ===
Nintendo's algorithm uses an unsigned 32-bit integer for the hash variable, and a '''''signed'' char variable'''. Also note that Nintendo iterates over each byte, not each string character.
Nintendo's algorithm uses an unsigned 32-bit integer for the hash variable. Also note 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++: