(root: &Path, name: &str, seed: u8)
| 62 | } |
| 63 | |
| 64 | fn write_key_file(root: &Path, name: &str, seed: u8) -> std::path::PathBuf { |
| 65 | let mut secret = [0u8; 32]; |
| 66 | for (index, byte) in secret.iter_mut().enumerate() { |
| 67 | *byte = seed.wrapping_add((index as u8) * 7 + 11); |
| 68 | } |
| 69 | let hex: String = secret.iter().map(|byte| format!("{byte:02x}")).collect(); |
| 70 | let path = root.join(name); |
| 71 | fs::write(&path, hex).expect("write key file"); |
| 72 | path |
| 73 | } |
| 74 | |
| 75 | fn git(root: &Path, args: &[&str]) -> Output { |
| 76 | Command::new("git") |
no test coverage detected