rot-13

Crates.iorot-13
lib.rsrot-13
version0.1.1
sourcesrc
created_at2019-08-17 15:00:02.23589
updated_at2019-08-17 15:09:20.923431
descriptionrot-13 encryption and decryption
homepage
repositoryhttps://github.com/cameronp98/rot13-rs.git
max_upload_size
id157643
size13,497
Cameron Phillips (cameronp98)

documentation

README

rot13

Rot-13 encryption and decryption (written in rust)

Build Status Crates.io Crates.io

USAGE:
    rot13 [FLAGS] [OPTIONS] --decrypt --encrypt

FLAGS:
    -d, --decrypt    decrypt the provided input
    -e, --encrypt    encrypt the provided input
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -i, --input <PATH>     the input file to use. defaults to stdin
    -o, --output <PATH>    the output file to use. defaults to stdout

Library usage:

use rot13::{rot13_slice, Mode};

fn main() {
    let input = b"Hello, World!";
    
    // try encryption
    let encrypted = rot13_slice(Mode::Encrypt, input);
    println!("{}", ::std::str::from_utf8(&encrypted).unwrap());
    
    // since case is preserved during encryption, the decrypted
    // product should be the same as the original input
    let decrypted = rot13_slice(Mode::Decrypt, &encrypted);
    assert_eq!(input, decrypted.as_slice());
}
Commit count: 11

cargo fmt