Skip to content
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.

quachtridat/crc-div

Repository files navigation

Cyclic Redundancy Check - Step-by-Step Division

Contributors Forks Stargazers Issues MIT License LinkedIn

About The Project

Cyclic Redundancy Check - Step-by-Step Division

Live demo at here.

This is a simple web app to simulate the process of modulo-2 division using exclusive-OR (XOR) operations on binary numbers used in Cyclic Redundancy Check (CRC).

In CRC division, numbers are "subtracted" using XOR operations. The division is used to produce an array of bits - the remainder bits R (of length r) - from two other arrays of bits D (data bits, of arbitrary length) and G (generator bits, of length r + 1).

The objective of the division is to find the remainder R, such that given D and G as described, the DR (the concatenation of D and R, or more formally, D times 2^r plus R) divided by G equals 0.

I started this project to reconsolidate my knowledge after learning about CRC at university (FDU Vancouver, course INFO-4102), as well as to get started with testing. There are only a few small tests written for now.

Built With

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

  • Node.js

  • npm

    npm install npm@latest -g

Installation

  1. Clone the repo

    git clone https://github.com/quachtridat/crc-div.git
    
  2. Install NPM packages

    npm install
  3. Start the development server

    npm run dev

Usage

There are 2 panels:

  • Control panel: Here you can enter the data bits and generator bits, see the number of steps, load input data and interact with the app to iterate through states and can even let the app iterate through states automatically.
  • Logging panel: Here you can see the division process in action. Description of each state is shown at the bottom of this panel.

Steps:

  1. Input data bits (max. 128 bits).
  2. Input generator bits (max. 128 bits).
  3. Optionally enable any modificators (e.g., Fast-forward indivisible steps).
  4. Click Load let the app load input data and generate states.
  5. To operate manually, click Next Step to progress to the next state.
  6. To let the app run automatically:
    1. Input the auto interval time length. This number (in milliseconds) indicates the time amount the app waits before progressing to the next state (if there is).
    2. Press Auto to start the automation.
    3. Press Pause at anytime to pause. Pressing Next Step also pauses the automation, except it also advances 1 extra step.
  7. The process stops when the result is out. At this time, there is no further states, so all auto and manual functions, except for the Load button, are disabled.

Contributing

This is a personal project, however I am happy that you checked this out. Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Dat Quach - LinkedIn - [email protected]

Project Link: https://github.com/quachtridat/crc-div