updated hard hash array
motivated by my roommate losing his badge also added automatic scrambler for array updates
This commit is contained in:
parent
f466f20869
commit
d464cf9fc8
5 changed files with 122 additions and 0 deletions
|
@ -40,10 +40,13 @@ impl Name {
|
|||
|
||||
match hash {
|
||||
0x14b9c91fe4505456 => Self::Evan,
|
||||
0x4a7c5fdd0ec5a6cd => Self::Evan, // not left in MN
|
||||
0x6b859025842cd369 => Self::Andy,
|
||||
0xb366d73deaaa8d9d => Self::Felix,
|
||||
0x30c79f56dc74f998 => Self::Phil,
|
||||
0xb64c08f6b9a50281 => Self::Michael,
|
||||
0x5c7a333b61014068 => Self::Amaia,
|
||||
0xc6f66b1a891c9352 => Self::Nathaniel,
|
||||
_ => Self::Unknown,
|
||||
}
|
||||
}
|
||||
|
|
1
scrambler/.gitignore
vendored
Normal file
1
scrambler/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
target
|
95
scrambler/Cargo.lock
generated
Normal file
95
scrambler/Cargo.lock
generated
Normal file
|
@ -0,0 +1,95 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "block-buffer"
|
||||
version = "0.10.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
|
||||
dependencies = [
|
||||
"generic-array",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cpufeatures"
|
||||
version = "0.2.16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crypto-common"
|
||||
version = "0.1.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
|
||||
dependencies = [
|
||||
"generic-array",
|
||||
"typenum",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "digest"
|
||||
version = "0.10.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
|
||||
dependencies = [
|
||||
"block-buffer",
|
||||
"crypto-common",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "generic-array"
|
||||
version = "0.14.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
|
||||
dependencies = [
|
||||
"typenum",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "keccak"
|
||||
version = "0.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654"
|
||||
dependencies = [
|
||||
"cpufeatures",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.169"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
|
||||
|
||||
[[package]]
|
||||
name = "scrambler"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"sha3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sha3"
|
||||
version = "0.10.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60"
|
||||
dependencies = [
|
||||
"digest",
|
||||
"keccak",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typenum"
|
||||
version = "1.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
|
||||
|
||||
[[package]]
|
||||
name = "version_check"
|
||||
version = "0.9.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
7
scrambler/Cargo.toml
Normal file
7
scrambler/Cargo.toml
Normal file
|
@ -0,0 +1,7 @@
|
|||
[package]
|
||||
name = "scrambler"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
sha3 = {version="0.10.0", default-features=false}
|
16
scrambler/src/main.rs
Normal file
16
scrambler/src/main.rs
Normal file
|
@ -0,0 +1,16 @@
|
|||
use std::io::stdin;
|
||||
|
||||
use sha3::{Digest, Sha3_256};
|
||||
|
||||
fn main() {
|
||||
let mut badge = String::new();
|
||||
stdin().read_line(&mut badge).unwrap();
|
||||
let badge: u64 = u64::from_str_radix(badge.trim().trim_start_matches(r#"0x"#), 16).unwrap();
|
||||
|
||||
let mut hasher = Sha3_256::new();
|
||||
hasher.update(badge.to_be_bytes());
|
||||
|
||||
let hash = hasher.finalize();
|
||||
let hash = u64::from_be_bytes(hash[..8].try_into().unwrap());
|
||||
println!("{hash:0x}");
|
||||
}
|
Loading…
Reference in a new issue