save apphashes

This commit is contained in:
dr-frmr 2023-10-06 13:31:12 -04:00
parent 3ba6d427fd
commit 062037b0ed
No known key found for this signature in database
11 changed files with 25 additions and 1 deletions

View File

@ -6,8 +6,10 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[build-dependencies]
zip = "0.6"
sha2 = "0.10"
walkdir = "2.4"
zip = "0.6"
[dependencies]
aes-gcm = "0.10.2"

View File

@ -1,3 +1,4 @@
use sha2::Digest;
use std::process::Command;
use std::{
fs, io,
@ -176,5 +177,17 @@ fn main() {
}
}
zip.finish().unwrap();
// Get hash of finished zip file
let zip_path = format!("{}/target/{}.zip", pwd.display(), name);
let mut zip_file = std::fs::File::open(&zip_path).unwrap();
let mut buffer = Vec::new();
zip_file.read_to_end(&mut buffer).unwrap();
let mut hasher = sha2::Sha256::new();
hasher.update(&buffer);
let result = hasher.finalize();
// save SHA256 hash of final product in module dir
let hash_path = format!("{}/modules/{}/.apphash", pwd.display(), name);
let mut hash_file = std::fs::File::create(&hash_path).unwrap();
hash_file.write_fmt(format_args!("{:x}", result)).unwrap();
}
}

View File

@ -0,0 +1 @@
be9c0e45b47ff913e492f53730f90a13072c94f77e99f134d2f2c5f56748b9b3

1
modules/chess/.apphash Normal file
View File

@ -0,0 +1 @@
f599f76aeee8563177e0713a04f6f6aac8716aeabfde97be7a1bb4773e5c6cae

View File

@ -0,0 +1 @@
a504354cea76c3c2773fe91883120f7b1f2cc567656e8403dcfa0063bd31bc0e

View File

@ -0,0 +1 @@
ea5e6674f91f787f6d9e3abe687c8392d6bc0c658ab98d9e74937d49b04bf18e

View File

@ -0,0 +1 @@
48f4ef3829780273446520fda11c8c9c3ab7ad88e09ad710f0f86283184f267d

1
modules/orgs/.apphash Normal file
View File

@ -0,0 +1 @@
c1f3cb7a0235c549f102ddd130152e8e8f18bcaf747de17b3ef85f797cedf6c4

View File

@ -0,0 +1 @@
9a11cdc3398f96c31af4153e90b910ab81bec7fd5df38499ff70da34bb358fab

1
modules/rpc/.apphash Normal file
View File

@ -0,0 +1 @@
7b0989497c52ca3f9daf7ede4def0ce3e3ce27ce35ac9b69b19dd5e38f996b5c

View File

@ -0,0 +1 @@
163b68aef60cadd2ffbd54794a4f0d52a998156ca1c1d16065a74babbc4fe92d