Attempt even dumber hashing mechanism

This commit is contained in:
Jonathan Kelley 2024-03-06 17:43:43 -08:00
parent 60616d0ba7
commit e02e41d6f1
No known key found for this signature in database
GPG key ID: 1FBB50F7EB0A08BE
2 changed files with 10 additions and 7 deletions

View file

@ -1,4 +1,4 @@
use std::{collections::hash_map::DefaultHasher, hash::Hasher, process::Command};
use std::process::Command;
fn main() {
// If any TS changes, re-run the build script
@ -31,12 +31,15 @@ fn hash_ts_files() -> u128 {
include_str!("src/ts/core.ts"),
];
for file in files.iter() {
let mut hasher = DefaultHasher::new();
hasher.write(file.as_bytes());
out += hasher.finish() as u128;
// Let's make the dumbest hasher by summing the bytes of the files
// The location is multiplied by the byte value to make sure that the order of the bytes matters
let mut idx = 0;
for file in files {
for byte in file.bytes() {
idx += 1;
out += (byte as u128) * (idx as u128);
}
}
out
}

View file

@ -1 +1 @@
31613791829349842071
12705686530