Attempt even dumber hashing mechanism
This commit is contained in:
2 files changed
+10
-7
No files matched your search
@@ -1,4 +1,4 @@
|
|||||||
use std::{collections::hash_map::DefaultHasher, hash::Hasher, process::Command};
|
use std::process::Command;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// If any TS changes, re-run the build script
|
// If any TS changes, re-run the build script
|
||||||
@@ -31,12 +31,15 @@ fn hash_ts_files() -> u128 {
|
|||||||
include_str!("src/ts/core.ts"),
|
include_str!("src/ts/core.ts"),
|
||||||
];
|
];
|
||||||
|
|
||||||
for file in files.iter() {
|
// Let's make the dumbest hasher by summing the bytes of the files
|
||||||
let mut hasher = DefaultHasher::new();
|
// The location is multiplied by the byte value to make sure that the order of the bytes matters
|
||||||
hasher.write(file.as_bytes());
|
let mut idx = 0;
|
||||||
out += hasher.finish() as u128;
|
for file in files {
|
||||||
|
for byte in file.bytes() {
|
||||||
|
idx += 1;
|
||||||
|
out += (byte as u128) * (idx as u128);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
out
|
out
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
31613791829349842071
|
12705686530
|
||||||
Reference in new issue
Block a user