https://github.com/sleekpanther/binary-hexadecimal-conversion
Binary hexadecimal converter
https://github.com/sleekpanther/binary-hexadecimal-conversion
binary binary-hexadecimal-converter binary-to-text conversion convert converter decimal hex hex-to-binary hexadecimal noah noah-patullo pattullo patullo patulo sleek-panther
Last synced: 4 months ago
JSON representation
Binary hexadecimal converter
- Host: GitHub
- URL: https://github.com/sleekpanther/binary-hexadecimal-conversion
- Owner: SleekPanther
- Created: 2017-03-02T23:48:07.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-12T11:32:09.000Z (about 8 years ago)
- Last Synced: 2025-01-15T13:08:05.674Z (5 months ago)
- Topics: binary, binary-hexadecimal-converter, binary-to-text, conversion, convert, converter, decimal, hex, hex-to-binary, hexadecimal, noah, noah-patullo, pattullo, patullo, patulo, sleek-panther
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Binary Hexadecimal Conversion
Convert hex to binary and binary to hex by slicing inputs & outputs into 4-bit nibbles## Notes
- Choose to which direction to convert
- Option to enter more conversions unless you quit## Limitations
- 32-bit binary input
Not really an issue, since you can simply change `MAX_BITS_ALLOWED` to allow infinite sequences of 0's and 1's## Code Details
- Uses 2 dictionaries of 4-bit nibbles to convert both ways
- Robust error handling checks:
- Binay input is <= 32 bits
- Empty string input is correctly returns 0000 binary or 0 hex
- Hex is converted to uppercase to avoid duplicate dictionary keys for lowercase
- Binary input is validated to make sure it is only 0's and 1's
- Hex input catches KeyErrors if the input is not a value 0-9 or A-F