2 releases

Uses old Rust 2015

0.1.1 May 3, 2015
0.1.0 May 3, 2015

#4 in #encodes

Download history 25/week @ 2024-07-25 27/week @ 2024-08-01 12/week @ 2024-08-08 48/week @ 2024-08-15 42/week @ 2024-08-22 38/week @ 2024-08-29 18/week @ 2024-09-05 21/week @ 2024-09-12 182/week @ 2024-09-19 321/week @ 2024-09-26 296/week @ 2024-10-03 273/week @ 2024-10-10 243/week @ 2024-10-17 250/week @ 2024-10-24 253/week @ 2024-10-31 147/week @ 2024-11-07

957 downloads per month
Used in macro-ob

MIT license

2KB

ROT13

A simple ROT13 encryption function. Can be applied on encrypted code again to reveal the plain text.

ROT13 works by shifting every character in the alphabet by 13 elements. This implementation maintains upper/lower cases and ignores non-[A-Za-z] characters, thus is safe to use on any string.

Takes a &str and returns a String.

This crate was created as an exercise for me to learn Rust, but it's tested and fully working (as far as I can tell), so go for it.

Example

extern crate rot13;

#[cfg(not(test))]
fn main() {
    println!("{}", rot13::rot13("Hello World!"));
}

No runtime deps