web3-starter-py/art_and_logic/1-efun
2022-03-23 18:25:34 +04:00
..
data Add some private projects 2022-03-23 18:25:34 +04:00
src Add some private projects 2022-03-23 18:25:34 +04:00
test Add some private projects 2022-03-23 18:25:34 +04:00
.gitignore Add some private projects 2022-03-23 18:25:34 +04:00
AlpcPart1-190801.pdf Add some private projects 2022-03-23 18:25:34 +04:00
main_test.py Add some private projects 2022-03-23 18:25:34 +04:00
Makefile Add some private projects 2022-03-23 18:25:34 +04:00
README.md Add some private projects 2022-03-23 18:25:34 +04:00
requirements.txt Add some private projects 2022-03-23 18:25:34 +04:00
setup.py Add some private projects 2022-03-23 18:25:34 +04:00
tox.ini Add some private projects 2022-03-23 18:25:34 +04:00

Efun: Art + Logic Enconding + Decoding

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 (as described in this doc.

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!