Caesar cipher CLI. Written in C.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
You will need a C compiler and GNU Make to compile the code. On Windows, it's probably easiest to use WSL.
Optional requirements:
To test the program, you will need to intall valgrind on your machine. See Testing for more informarion.
To benchmark the binary, you will need to install hyperfine on your machine. See Benchmarking for more information.
Clone the git repository and navigate into the folder.
git clone https://github.com/umcconnell/ccaesar.git
cd ccaesar/
To be able to run the program, it must first be compiled. Compile the program using make:
make
All examples in this section assume you have compiled the program. See the "Building" section for compilation instructions.
You can run the program by piping your text into ccaesar
or inputting it
directly in interactive mode.
If you're piping in text over STDIN
, you can for example run the following
command, using the provided example text files:
cat test/test2.txt | ./ccaesar -s 7
If you're using interactive mode, just run:
./ccaesar -s 7
For a list of all available options and examples, run:
./ccaesar --help
Assuming you've compiled the program as outlined in the "Building" section, you can install the binary.
First, make it executable:
chmod a+x ./ccaesar
For a system-wide installation, /usr/local/bin
is the recommended location to
place the binary in:
sudo cp ./ccaesar /usr/local/bin
The tests use valgrind to check for memory issues. Make sure you've installed it before continuing.
To test the program, use make:
make test
Benchmarking is done using hyperfine. Make sure you've installed it before continuing.
To benchmark the binary, use make:
make bench
Using James Joyce's Ulysses as input to ccaesar
yields the
following results on a laptop (Intel i7-9750H):
$ hyperfine --warmup 3 'cat test/test2.txt | ./ccaesar -s 7 -c'
Benchmark #1: cat test/test2.txt | ./ccaesar -s 7 -c
Time (mean ± σ): 14.5 ms ± 1.0 ms [User: 14.1 ms, System: 2.3 ms]
Range (min … max): 13.3 ms … 20.7 ms 180 runs
Please read CONTRIBUTING.md and CODE_OF_CONDUCT.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
Ulysse McConnell - umcconnell
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE file for details.