OrangeGuidanceTomestone/server/src/util.rs

53 lines
663 B
Rust
Raw Normal View History

2022-09-03 10:35:15 +00:00
use sha3::{Digest, Sha3_384};
2023-01-29 09:26:58 +00:00
// TerritoryIntendedUse = 13 or 14
pub const HOUSING_ZONES: &[u32] = &[
282,
283,
284,
339,
340,
341,
342,
343,
344,
345,
346,
347,
384,
385,
386,
423,
424,
425,
573,
574,
575,
608,
609,
610,
641,
649,
650,
651,
652,
653,
654,
655,
979,
980,
981,
982,
983,
984,
985,
999,
];
2022-09-03 10:35:15 +00:00
pub fn hash(input: &str) -> String {
let mut hasher = Sha3_384::default();
hasher.update(input.as_bytes());
let result = hasher.finalize();
2024-06-05 17:44:10 +00:00
data_encoding::BASE64.encode(&result)
2022-09-03 10:35:15 +00:00
}