Clean up challenge 1 for easier future use.
This commit is contained in:
17
src/main.rs
17
src/main.rs
@@ -1,20 +1,7 @@
|
||||
mod set1;
|
||||
|
||||
use crate::set1::{base64_to_string, bytes_to_base64, to_bytes};
|
||||
|
||||
fn test_set1() {
|
||||
let input = to_bytes("49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d");
|
||||
let expected = String::from("SSdtIGtpbGxpbmcgeW91ciBicmFpbiBsaWtlIGEgcG9pc29ub3VzIG11c2hyb29t");
|
||||
match input {
|
||||
Ok(bytes) => {
|
||||
let output = base64_to_string(bytes_to_base64(bytes));
|
||||
assert_eq!(output, expected);
|
||||
println!("{:?}", output);
|
||||
}
|
||||
Err(e) => println!("Error: {:?}", e),
|
||||
};
|
||||
}
|
||||
use crate::set1::challenge1;
|
||||
|
||||
fn main() {
|
||||
test_set1();
|
||||
challenge1();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user