2 releases

0.1.1 Apr 14, 2024
0.1.0 Apr 1, 2024

#462 in Text processing

Download history 143/week @ 2024-04-01 112/week @ 2024-04-08 41/week @ 2024-04-15

296 downloads per month

MIT license

18KB
483 lines

Cerpton

A "double" Caesar cipher that contains a mix of different alphabets. Cerpton takes two values and shifts the "alphabet" starting from two different positions (a long with a few extra things).

Example:

use cerpton::{Encoder, libcerpton_encode};

let mut encoder = Encoder::new(2, 1);

// Creates a new ``Alphabet``
encoder.set_alphabet();

// Check if the input setting is ok
if !encoder.setting_good() {
    panic!("Invalid setting");
}

let regular_text = String::from("This is some text!!!");
let encoded_text = encoder.encode(regular_text);

println!("{} -> {}", regular_text, encoded_text);
// "This is some text!!!" -> "Sg  غ[ШJ KJwKللل"

// Or using a single function:
let encoded_text = libcerpton_encode([2, 1, 0, 0, 0, 0], regular_text);

Dependencies

~3MB
~117K SLoC