Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jd91mzm2/rot26
Pure rust implementation of the rot26 algorithm
https://github.com/jd91mzm2/rot26
caesar-cipher encryption rot13 rust
Last synced: 23 days ago
JSON representation
Pure rust implementation of the rot26 algorithm
- Host: GitHub
- URL: https://github.com/jd91mzm2/rot26
- Owner: jD91mZM2
- License: mit
- Created: 2018-01-12T16:05:21.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-21T09:37:18.000Z (over 6 years ago)
- Last Synced: 2024-10-11T23:44:59.326Z (about 1 month ago)
- Topics: caesar-cipher, encryption, rot13, rust
- Language: Rust
- Size: 16.6 KB
- Stars: 24
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [rot26](http://rot26.org/) [![Crates.io](https://img.shields.io/crates/v/rot26.svg)]()
> ROT13 ("rotate by 13 places", sometimes hyphenated ROT-13) is a letter substitution cipher that replaces a letter with the letter 13 letters after it in the alphabet.
> Instead of only rotating 13 places, ROT26 rotates twice as many characters in the alphabet and is therefore twice as secure.Pure rust rewrite of the rot26 algorithm.
Even maintains support for rot13 and *any* rot, with friendly helpful comments advising you to just stick to rot26.> ROT26 encryption & decryption is very complex and requires a powerful, purpose-built super-computer to perform all the calculations... which we have created.
> So, to encourage more developers to use ROT26 in their mobile, web and PC software applications we are offering a very easy to use and totally free ROT26 encryption and decryption REST web service.This is no longer true.
That and all the following are features now possible thanks to Rust:- Complete unicode support. Disregards any non-alphabetical symbols! (was probably possible before actually)
- Unit tests.## Speeeeeeeed
If being able to actually run this heavy algorithm on your computer isn't facinating enough,
you can also use `rayon` for multithreading!
Simply use it with the `rayon` feature. But by default, rot26 is and forever will be\* without dependencies.\* no promises
# Examples
Simply call `rot26::encrypt` on any string. For example:
```Rust
rot26::encrypt("hello") // returns "hello"
```to decrypt, use `rot26::decrypt`
```Rust
rot26::decrypt("hello") // returns "hello"
```# Support for C!
Because C is the mostly used language, we've spent more time porting this algorithm than it would take to rewrite it in C.
Now you can get Rust's awesome unicode support while still using C!
It's kind of like buying a new saddle for your dead horse!Simply link it with `target/release/librot26.a` and include `rot26.h`!
Example:
```C
const char* encrypted = rot26_encrypt("hello");
puts(encrypted);rot26_free(encrypted);
```