omkar-bitly
v1.0.0
Published
A Node.js CLI playground for exploring how data is represented inside computers.
Maintainers
Readme
BitLab
A Node.js CLI playground for exploring how data is represented inside computers.
BitLab converts values between:
- binary
- decimal
- hexadecimal
- octal
The tool also displays:
- UTF-8 byte representations
- machine endianness
- character encoding information
The project is focused on understanding:
- binary systems
- encoding
- buffers
- bytes
- low-level data representation
Features
Interactive REPL
Start an interactive terminal session.
Command:
bitlabExample:
bitlab >Requirements:
- keep terminal session active
- accept user input continuously
- process values in real time
- support
exitcommand
Feature Breakdown
1. Number System Conversion
Convert numbers into:
- binary
- hexadecimal
- octal
- decimal
Example Input:
255Example Output:
Decimal : 255
Binary : 11111111
Hex : FF
Octal : 377Requirements:
- detect numeric input
- support positive integers
- keep output aligned and readable
2. Character Encoding Viewer
Display UTF-8 byte representation for characters and strings.
Example Input:
AExample Output:
Character : A
UTF-8 : 41
Binary : 010000013. UTF-8 Byte Viewer
Display UTF-8 bytes for text input.
Example Input:
helloExample Output:
68 65 6C 6C 6FRequirements:
- convert text into byte buffer
- display bytes in hexadecimal format
- support unicode characters
4. Unicode Character Support
Support unicode input.
Example Input:
₹Example Output:
UTF-8 Bytes : E2 82 B9Purpose:
- demonstrate multi-byte character encoding
- show difference between characters and bytes
5. Endianness Detection
Display current machine byte order.
Example Output:
Machine Endianness : Little EndianRequirements:
- detect endianness using Node.js APIs
- support Windows, Linux, and macOS
6. Byte Order Mark (BOM) Detection
Detect BOM sequences inside file or buffer input.
Supported Types:
- UTF-8 BOM
- UTF-16 LE BOM
- UTF-16 BE BOM
Purpose:
- demonstrate encoding metadata
- understand how text encodings are identified
Supported Commands
Start Interactive Mode
bitlabExit Interactive Mode
exitConvert Number
255Convert Character
AConvert Unicode Character
₹Project Structure
bitlab/
│
├── converters/
│ ├── binary.js
│ ├── decimal.js
│ ├── hex.js
│ ├── octal.js
│ └── utf8.js
│
├── repl/
│ └── startRepl.js
│
├── utils/
│ ├── formatter.js
│ ├── parser.js
│ ├── endian.js
│ └── bom.js
│
├── index.js
├── package.json
├── README.md
└── .gitignoreRequirements
- support interactive CLI usage
- support unicode characters
- keep output readable
- separate converters into modules
- handle invalid input safely
- support Windows, Linux, and macOS
Error Cases To Handle
- empty input
- unsupported values
- invalid numeric conversion
- malformed unicode input
- unsupported encoding sequences
Technical Concepts Used
- binary systems
- hexadecimal conversion
- octal conversion
- UTF-8 encoding
- buffers
- bytes
- endianness
- readline interface
- interactive terminal applications
Learning Goals
This project is focused on understanding:
- how computers represent data
- how text becomes bytes
- how encoding systems work
- how binary values are stored
- how terminal REPL applications function
Final Result
A terminal-based binary and encoding playground for experimenting with:- number system conversion
- UTF-8 encoding
- byte representation
- machine-level data formatting
