web3-starter-py/small-projects/enconding-decimals
mvonsteinkirch d24d37806d 💾
2022-12-24 14:51:10 -08:00
..
data Add dir with some small projects 2022-03-23 18:41:46 +04:00
src Add dir with some small projects 2022-03-23 18:41:46 +04:00
test Add dir with some small projects 2022-03-23 18:41:46 +04:00
.gitkeep Add dir with some small projects 2022-03-23 18:41:46 +04:00
main_test.py Add dir with some small projects 2022-03-23 18:41:46 +04:00
Makefile Add dir with some small projects 2022-03-23 18:41:46 +04:00
README.md Add dir with some small projects 2022-03-23 18:41:46 +04:00
requirements.txt Add dir with some small projects 2022-03-23 18:41:46 +04:00
setup.py 💾 2022-12-24 14:51:10 -08:00
tox.ini Add dir with some small projects 2022-03-23 18:41:46 +04:00

Enconding decimals

This program:

i) converts and encodes a 14-bit decimal input value to a 2-byte hexadecimal, ii) decodes hexadecimal representations to 14-bit decimal

Installing

Create and source virtual enviroment. You can use virtualenv or conda:

virtualenv venv
source venv/bin/activate

Install dependencies:

make setup

Install Efun:

 make install

Usage

Encoding

To enconde a integer, run:

efun -e <integer>

Note that the value must be in the range [-8192, 8191].

Decoding

To decode an integer, run:

efun -d <integer>

Note that the value must be in the range [0x0000, 0x7F7F].

Developer

Running tests

You can run tests with:

make test

Linting

You can lint your code with:

make lint

Cleaning up

Clean residual compilation and installation files with:

make clean

Thank you for reading my code!