MCPcopy Create free account
hub / github.com/Dadoum/android-loader / hash

Method hash

src/android_library.rs:71–79  ·  view source on GitHub ↗
(symbol_name: &str)

Source from the content-addressed store, hash-verified

69 }
70
71 fn hash(symbol_name: &str) -> u32 {
72 let mut h: u32 = 5381;
73
74 for c in symbol_name.chars() {
75 h = (h << 5).wrapping_add(h.wrapping_add(c as u32));
76 }
77
78 h
79 }
80
81 pub unsafe fn lookup(&self, android_library: &AndroidLibrary, symbol: &str, dynstrtab: &[u8]) -> Option<*const ()> {
82 let hash = Self::hash(symbol);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected