A tool to convert numbers into various other formats and different sized integers
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
epicnumbers-1.0.0.tar.gz
(3.9 kB
view hashes)
Built Distribution
Close
Hashes for epicnumbers-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c79b4d8fc5e81ac668fe52eb4f9574192897799765b65c8f62677f992a68833b |
|
MD5 | 1d959aa9d067498c3ce63d2f6932b2eb |
|
BLAKE2b-256 | 2d8a7b1c4f1af8be33687fdab1916ef2aafb679aeaf271b38d8325d3354ff22b |