SARC: Difference between revisions

180 bytes removed ,  5 years ago
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'''. It is also misleading in that Nintendo iterates over each byte, not each string character.
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.


Here is an accurate implementation of the algorithm, written in C++:
Here is an accurate implementation of the algorithm, written in C++:
Line 21: Line 21:
}
}
</source>
</source>
It appears that Nintendo's compiler treats a char as a signed type.


== Usage in ''Breath of the Wild'' ==
== Usage in ''Breath of the Wild'' ==
Anonymous user