Skip to content

Commit 068189f

Browse files
committed
fix(Archive): make sure binsafe hashes are calculated correctly
1 parent f564e14 commit 068189f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/archive/ArchiveBinsafe.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,12 +443,12 @@ namespace zenkit {
443443
this->_m_write->write_ushort(key.length());
444444
this->_m_write->write_ushort(value);
445445

446-
auto hash_value = 0u;
446+
uint32_t hash_value = 0u;
447447
for (char c : key) {
448448
hash_value = hash_value * 0x21 + c;
449449
}
450450

451-
this->_m_write->write_uint(hash_value & 0x61);
451+
this->_m_write->write_uint(hash_value % 0x61);
452452
this->_m_write->write_string(key);
453453
}
454454

0 commit comments

Comments
 (0)