fold nested literal binary expressions

This commit is contained in:
2025-12-05 23:25:23 -07:00
parent 9993bff574
commit a60e9d7dce
10 changed files with 176 additions and 60 deletions

View File

@@ -0,0 +1,11 @@
use crc32fast::hash as crc32_hash;
/// This function takes an input which is meant to be hashed via the CRC32 algorithm, but it then
/// converts the generated UNSIGNED number into it's SIGNED counterpart.
pub fn crc_hash_signed(input: &str) -> i128 {
let hash = crc32_hash(input.as_bytes());
// in stationeers, crc32 is a SIGNED int.
let hash_value_i32 = i32::from_le_bytes(hash.to_le_bytes());
hash_value_i32 as i128
}

View File

@@ -1,3 +1,4 @@
mod helper_funcs;
mod macros;
mod syscall;
@@ -11,5 +12,6 @@ pub trait Documentation {
}
pub mod prelude {
pub use super::helper_funcs::*;
pub use super::{Documentation, documented, with_syscalls};
}