Coder Social home page Coder Social logo

ccaesar's Introduction

ccaesar

test

Caesar cipher CLI. Written in C.

Table of Contents

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

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.

Initial setup

Clone the git repository and navigate into the folder.

git clone https://github.com/umcconnell/ccaesar.git
cd ccaesar/

Using

Building

To be able to run the program, it must first be compiled. Compile the program using make:

make

Running

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

Installing

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

Testing

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

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

Contributing

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.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

Ulysse McConnell - umcconnell

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details.

ccaesar's People

Contributors

umcconnell avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.