First try

This commit is contained in:
2025-08-14 11:03:14 -04:00
parent b6a98b919c
commit 45bc4c3cb8
3 changed files with 37 additions and 1 deletions

25
Cargo.lock generated Normal file
View File

@@ -0,0 +1,25 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "autocfg"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
[[package]]
name = "substring"
version = "1.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42ee6433ecef213b2e72f587ef64a2f5943e7cd16fbd82dbe8bc07486c534c86"
dependencies = [
"autocfg",
]
[[package]]
name = "winlink-password"
version = "0.1.0"
dependencies = [
"substring",
]

View File

@@ -4,3 +4,4 @@ version = "0.1.0"
edition = "2024"
[dependencies]
substring = "1.4.5"

View File

@@ -1,3 +1,13 @@
use substring::Substring;
fn main() {
println!("Hello, world!");
let password = "abcdefghijklmnopqrstuvwxyz";
println!("Password: {}", password_decode(&password, 3));
}
fn password_decode(password: &str, code: i32) -> String
{
let decode_password = password.substring(code.try_into().unwrap(), 2);
return decode_password.to_string();
}