dec2hex is a command-line Rust application that converts decimal numbers to hexadecimal. Whether you need to convert a single decimal number or process multiple numbers stored in a text file, dec2hex provides a reliable solution.
- Convert individual decimal numbers to hexadecimal.
- Process decimal numbers stored in a text file and output their hexadecimal representations.
To convert a single decimal number to hexadecimal, simply run the following command:
dec2hex <DECIMAL_NUMBER>
Replace <DECIMAL_NUMBER>
with the decimal number you want to convert.
If you have decimal numbers stored in a text file and want to convert them to hexadecimal, use the following command:
dec2hex -f <INPUT_FILE> -o <OUTPUT_FILE>
Replace <INPUT_FILE>
with the path to your input file containing decimal numbers, and <OUTPUT_FILE>
with the desired name for the output file containing hexadecimal representations.
Please note that
<OUTPUT_FILE>
is an optional parameter and is not required by<INPUT_FILE>
.
Currently there is a precompiled version for Windows only.
To build dec2hex, make sure you have a working installation of the Rust toolchain (typically installed via rustup) on your system. Then, clone this repository and navigate to its directory:
git clone https://github.com/toaaa/dec2hex.git
cd dec2hex
Next, build the application using Cargo:
cargo build --release
Once the build process is complete, you can find the executable file in the target/release
directory.
Alternatively, you can run it using:
cargo run --release