MCPcopy Create free account
hub / github.com/TheRedDeveloper/ply-engine / hash_number

Function hash_number

src/engine.rs:810–824  ·  view source on GitHub ↗
(offset: u32, seed: u32)

Source from the content-addressed store, hash-verified

808}
809
810fn hash_number(offset: u32, seed: u32) -> Id {
811 let mut hash = seed;
812 hash = hash.wrapping_add(offset.wrapping_add(48));
813 hash = hash.wrapping_add(hash << 10);
814 hash ^= hash >> 6;
815 hash = hash.wrapping_add(hash << 3);
816 hash ^= hash >> 11;
817 hash = hash.wrapping_add(hash << 15);
818 Id {
819 id: hash.wrapping_add(1),
820 offset,
821 base_id: seed,
822 string_id: StringId::empty(),
823 }
824}
825
826fn hash_string_contents_with_config(
827 text: &str,

Calls

no outgoing calls

Tested by

no test coverage detected