Skip to content

A Caesar Cipher application which encodes Jane Austen's Pride and Prejudice. This was my first experience with Rust - I chose to work with this because of it multithreading capabilities.

Notifications You must be signed in to change notification settings

natasha-mann/caesar-cipher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Caesar Cipher

It was said that Julius Caesar protected his private documents by encrypting them using a cipher. The cypher works by taking each letter of the input text and shifting it by a number of letters. If the shift takes the letter past the end of the alphabet then it moves back to the beginning of the alphabet. In the case of a shift by 2 , w, x , y and z would map to y, z, a, b. Case ought to be preserved, and any non-(A-Z/a-z) characters are left unmodified.

The challenge this week is to encrypt the entirety of Jane Austin's "Pride and Prejudice" as fast as possible (without using any compile-time pre-computation). You can disregard any time taken to read/write the problem and its output to disk.

Rewards:

  • 5 Points are awarded for encoding the book in under 500ms
  • 2 Further points are awarded for encoding the book in under 100ms
  • 2 Further points are awarded for encoding the book in under 50ms

The remaining 1 point is awarded to the fastest submission.

Getting Started

git clone [email protected]:natasha-mann/caesar-cipher.git
cargo run

The shift value is currently set at 2. The value of this can be changed on line 17 of main.rs

Tests

To test the application run:

cargo test

About

A Caesar Cipher application which encodes Jane Austen's Pride and Prejudice. This was my first experience with Rust - I chose to work with this because of it multithreading capabilities.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages