This commit is contained in:
2026-08-19 12:27:35 -04:00
commit 2c6615ea48
5 changed files with 150 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/target

99
Cargo.lock generated Normal file
View File

@@ -0,0 +1,99 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "block-buffer"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2f6c7dbe95a6ed67ad9f18e57daf93a2f034c524b99fd2b76d18fdfeb6660aa"
dependencies = [
"hybrid-array",
]
[[package]]
name = "cfg-if"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
[[package]]
name = "const-oid"
version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c"
[[package]]
name = "cpufeatures"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201"
dependencies = [
"libc",
]
[[package]]
name = "crypto-common"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453"
dependencies = [
"hybrid-array",
]
[[package]]
name = "digest"
version = "0.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2"
dependencies = [
"block-buffer",
"const-oid",
"crypto-common",
]
[[package]]
name = "hex"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
[[package]]
name = "hybrid-array"
version = "0.4.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "707114b52a152fa7bdb290cd7cd5912d9467273b6d74e21b8d81aca1f8533f6b"
dependencies = [
"typenum",
]
[[package]]
name = "libc"
version = "0.2.189"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
[[package]]
name = "sha2"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "446ba717509524cb3f22f17ecc096f10f4822d76ab5c0b9822c5f9c284e825f4"
dependencies = [
"cfg-if",
"cpufeatures",
"digest",
]
[[package]]
name = "timbre"
version = "0.1.0"
dependencies = [
"hex",
"sha2",
]
[[package]]
name = "typenum"
version = "1.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20"

8
Cargo.toml Normal file
View File

@@ -0,0 +1,8 @@
[package]
name = "timbre"
version = "0.1.0"
edition = "2024"
[dependencies]
hex = "0.4.3"
sha2 = "0.11.0"

BIN
cat_01.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

42
src/main.rs Normal file
View File

@@ -0,0 +1,42 @@
use core::panic;
use sha2::{Digest, Sha256};
use std::{
fs::{File, create_dir_all},
io::{BufReader, Read},
};
#[cfg(not(target_os = "linux"))]
compile_error!("kitty like linux more");
fn hashcat() {
let file = File::open("cat_01.jpg").expect("how dare u! i want my cat back :(");
let mut cat = BufReader::new(file);
let mut hasher = Sha256::new();
let mut buffer = [0u8; 4096];
loop {
let bytes_read = cat.read(&mut buffer).expect("what happened to my cat!?");
if bytes_read == 0 {
break;
}
hasher.update(&buffer[..bytes_read]);
}
let file_hash = hex::encode(hasher.finalize());
if !file_hash
.eq_ignore_ascii_case("45d4cf2fb11999c39ec5cd0cbedb436767421c8b8dab575c76f0b6ad9265d640")
{
panic!("this is not my cat. where is my cat. what did you do!? KITTYYYYYYYYYY")
}
}
fn main() {
hashcat(); // meow
let timbre_dir = std::env::home_dir()
.expect("NERD!!!")
.join("Music")
.join("Timbre");
create_dir_all(timbre_dir).expect("wat");
}