epicnumbers
A small tool I often used to convert a number into various other formats
Usage
$ pip install epicnumbers
$ epicnumbers <number>
Examples
Convert -100 into signed, unsigned, hex, printable and binary in different sized integers
$ en -100
type signed unsigned hex printable binary
------ -------- -------------------- ------------------- -------------------------------- -----------------------------------------------------------------------
8 bit -100 156 0x9c \x9c 10011100
16 bit -100 65436 0xff9c \x9c\xff 11111111 10011100
32 bit -100 4294967196 0xffffff9c \x9c\xff\xff\xff 11111111 11111111 11111111 10011100
64 bit -100 18446744073709551516 0xffffffffffffff9cL \x9c\xff\xff\xff\xff\xff\xff\xff 11111111 11111111 11111111 11111111 11111111 11111111 11111111 10011100
Convert 0x100 into signed, unsigned, hex, printable and binary in different sized integers
$ en 100h
type signed unsigned hex printable binary
------ -------- ---------- ----- -------------------------------- ----------
16 bit 256 256 0x100 \x00\x01 1 00000000
32 bit 256 256 0x100 \x00\x01\x00\x00 1 00000000
64 bit 256 256 0x100 \x00\x01\x00\x00\x00\x00\x00\x00 1 00000000
Convert 100b (binary) into signed, unsigned, hex, printable and binary in different sized integers
$ en 100b
type signed unsigned hex printable binary
------ -------- ---------- ----- -------------------------------- --------
8 bit 4 4 0x4 \x04 100
16 bit 4 4 0x4 \x04\x00 100
32 bit 4 4 0x4 \x04\x00\x00\x00 100
64 bit 4 4 0x4 \x04\x00\x00\x00\x00\x00\x00\x00 100
Development
- install poetry
$ poetry install$ poetry shell
Run tests
$ poetry run pytest
Run tool
$ poetry run en 100h
Metadata
Release files for epicnumbers 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| epicnumbers-1.1.0.tar.gz | 4.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| epicnumbers-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.1 kB
Release files / epicnumbers-1.1.0.tar.gz
| Download URL | epicnumbers-1.1.0.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1a7dafa6b8a2618dd3a5fca0e57ab4db304860a1b9e89799450d690db7a1a3cc
|
|
BLAKE2b-256 checksum How to use checksums |
7d38be940cd19ed13069094592e86c70dde330f8a950090ec0748018c45d2c71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.9.0 Darwin/20.6.0
|
Release files / epicnumbers-1.1.0-py3-none-any.whl
| Download URL | epicnumbers-1.1.0-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c5dc16fb76696b7394a3c881f8314217aa454883f95f4f2041b32071de3e5351
|
|
BLAKE2b-256 checksum How to use checksums |
e230477a7686543c963df9fa359112bb8bf1e095b4eedbb53af4331b2cc4d0d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.9.0 Darwin/20.6.0
|