From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "behavior" |
|---|
| subject | "Format:SARC archive" |
|---|
| claim | "SARC file names are hashed as hash = hash * multiplier + c over the name characters (u32 wrap), where c is a signed char in oead (a byte >= 0x80 is sign-extended before the multiply-add on platforms with signed char); the multiplier is the hash_multiplier field of the SFAT header (oead's writer defaults to 0x65). The SFAT entries are sorted ascending by this hash for binary search." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:SARC archive" |
|---|
| observed_in | |
|---|
|
|---|
| data | | effect | "hash = hash * multiplier + c for each character of the path, starting at 0, 32-bit wraparound; the SFAT entry table is sorted ascending by this value" |
|---|
| trigger | "looking up a file by name" |
|---|
| setting | "SFAT hash_multiplier, 0x65 in files written by oead" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "constexpr HashName loop and the sort by hash; default m_hash_multiplier = 0x65 in src/include/oead/sarc.h" |
|---|
| repo | "https://github.com/zeldamods/oead" |
|---|
| commit | "5fb74e1128468380b47da23a5690891c8af4ab72" |
|---|
| path | "src/sarc.cpp" |
|---|
| lines | "87-93, 266-270" |
|---|
|
| type | "source" |
|---|
| detail | "Read HashName (for (const char c : name) hash = hash * multiplier + c), the reader taking m_hash_multiplier from the SFAT header, the writer sort by hash, and m_hash_multiplier = 0x65 in sarc.h." |
|---|
| repo | "https://github.com/zeldamods/oead" |
|---|
| commit | "5fb74e1128468380b47da23a5690891c8af4ab72" |
|---|
| path | "src/include/oead/sarc.h" |
|---|
| lines | "168" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "SARC name hash" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-18T13:56:03.413Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T08:48:12.822Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read oead src/sarc.cpp at 5fb74e1: HashName loops 'for (const char c : name) hash = hash * multiplier + c' (u32), the writer sorts files by HashName (line 268-269), and the reader looks up by HashName with m_hash_multiplier." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T04:50:02.361Z" |
|---|
| summary | "oead hashes `const char c`, so on platforms where char is signed, bytes >= 0x80 are sign-extended into the u32 arithmetic; the claim omitted this. Read HashName, SarcWriter::Write sort, the reader…" |
|---|
| changed | |
|---|
|
|
|---|