Skip to content

Celestine1729/x6c1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

x6c1 - Hex Translator

A comprehensive command-line tool and Python library for converting between hexadecimal representations and their corresponding text or numeric values with file support.

Installation

pip install x6c1

Usage

Command Line

# Convert hex to text
x6c1 --hex "48656c6c6f20576f726c64"

# Convert text to hex
x6c1 --text "Hello World"

# Convert number to hex
x6c1 --numhex 255
x6c1 --numhex 3.14

# Convert hex to number
x6c1 --hexnum "ff"
x6c1 --hexfloat "40091eb851eb851f"

# Process files
x6c1 --file input.txt --output output.txt --hex

# Formatting options
x6c1 --text "Hello" --group-size 4 --prefix "0x"
x6c1 --numhex 3.14 --float-bits 32

Python API

from x6C1 import hex_to_text, text_to_hex, number_to_hex, hex_to_number

# Convert hex to text
text = hex_to_text("48656c6c6f")  # Returns "Hello"

# Convert text to hex
hex_str = text_to_hex("Hello")  # Returns "48656c6c6f"

# Convert number to hex
hex_num = number_to_hex(255)  # Returns "0xff"
hex_float = number_to_hex(3.14)  # Returns "40091eb851eb851f"

# Convert hex to number
number = hex_to_number("ff", False)  # Returns 255
float_num = hex_to_number("40091eb851eb851f", True)  # Returns 3.14

# Process files
from x6C1 import process_file
process_file("input.txt", "output.txt", hex_to_text)

Contact

Reach me at celestine1729@proton.me <3