This commit is contained in:
2024-01-25 21:51:23 +00:00
parent 57d216cdab
commit 7b6a16b662
13 changed files with 493 additions and 0 deletions

14
crypto/vigenere/.gitignore vendored Normal file
View File

@@ -0,0 +1,14 @@
# Generated by Cargo
# will have compiled files and executables
debug/
target/
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
# These are backup files generated by rustfmt
**/*.rs.bk
# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

View File

@@ -0,0 +1,8 @@
[package]
name = "vigenere"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

View File

@@ -0,0 +1,22 @@
fn vigenere(input: &str, key: &str) -> String {
let mut out = String::new();
out
}
fn main() {
println!("Hello, world!");
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn vigenere_wiki1() {
let message = "attacking tonight";
let key = "OCULORHINOLARINGOLOGY";
let out = "ovnlqbpvt hznzouz";
assert_eq!(vigenere(&message, &key), out);
}
}