caesarlib 0.1.3

A Caesar-Cipher library for Rust.
Documentation

caesarlib

Caesar cipher capabilities for Rust. Current Version Build Status

Usage

Add this to your Cargo.toml:

[dependencies]
caesarlib = "0.1.3"

and this to your crate root:

extern crate caesarlib;

use caesarlib::*;

Methods

fn encipher(offset: u16, message: &str) -> String;

fn decipher(offset: u16, message: &str) -> String;

// Returns randomly-generated offset and enciphered text
fn rdm_encipher(message: &str) -> (u16, String)

CLI tool

You can try the lib using the caesar-cli tool:

$ caesarlib encipher "Carolus Magnus" --offset 87
OmDAxGE YmszGE

$ caesarlib decipher "OmDAxGE YmszGE" --offset 87
Carolus Magnus

$ caesarlib encipher "Carolus Magnus" --offset 87 | caesarlib decipher --offset 87
Carolus Magnus

Contributors

Background

This was inspired by my Caesar Cipher algorithm implentation in Swift used in my iOS application caesarlib