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.
To get a local copy up and running follow these simple steps.
-
npm
npm install npm@latest -g
-
Clone the repo
git clone https://github.com/quachtridat/crc-div.git
-
Install NPM packages
npm install
-
Start the development server
npm run dev
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:
- Input data bits (max. 128 bits).
- Input generator bits (max. 128 bits).
- Optionally enable any modificators (e.g.,
Fast-forward indivisible steps
). - Click
Load
let the app load input data and generate states. - To operate manually, click
Next Step
to progress to the next state. - To let the app run automatically:
- 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).
- Press
Auto
to start the automation. - Press
Pause
at anytime to pause. PressingNext Step
also pauses the automation, except it also advances 1 extra step.
- 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.
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.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Dat Quach - LinkedIn - [email protected]
Project Link: https://github.com/quachtridat/crc-div