mirror of
https://github.com/Xevion/dynamic-preauth.git
synced 2025-12-06 03:14:58 -06:00
Extend value size to 1024
This commit is contained in:
@@ -22,12 +22,14 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
let dest_path = Path::new(&out_dir).join("key.json");
|
let dest_path = Path::new(&out_dir).join("key.json");
|
||||||
let mut f = BufWriter::new(File::create(&dest_path)?);
|
let mut f = BufWriter::new(File::create(&dest_path)?);
|
||||||
|
|
||||||
let compile_time = chrono::Utc::now().to_rfc3339();
|
// The value is just a 1024 character random string
|
||||||
let value = "Hello, world!";
|
let value = "a".repeat(1024);
|
||||||
|
|
||||||
let value_hash = sha2::Sha256::digest(value.as_bytes());
|
let value_hash = sha2::Sha256::digest(value.as_bytes());
|
||||||
|
let compile_time = chrono::Utc::now().to_rfc3339();
|
||||||
|
|
||||||
let key_data = KeyData {
|
let key_data = KeyData {
|
||||||
value,
|
value: &value,
|
||||||
value_hash: hex::encode(value_hash),
|
value_hash: hex::encode(value_hash),
|
||||||
compile_time,
|
compile_time,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user