Skip to content

Python tool to convert ascii codes to hex (and back)

Notifications You must be signed in to change notification settings

AndiJo80/asc2hex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

asc2bin

Summary

Convert hex codes into ascii characters (and back) via the command line.

Requires Python3 to run:
https://www.python.org/

hex2asc.py - convert ascii hex codes to characters
asc2hex.py - convert characters to ascii hex codes

Usage

Both programs, hex2asc and asc2hex, are both used in very similar ways. They supports different cases:

  • without input and output to console (stdout)
  • with input from console (stdin) and output to console (stdout)
  • with input from file and output to console (stdout)
  • with input from file and output to file

Run with Python

echo 41424344 | python hex2asc.py 
ABCD

or

python hex2asc.py input.txt output.bin

-> reaad file input.txt and writes result to file output.bin

or

python hex2asc.py input.txt

-> reads file input.txt and writes result to stdout

or

python hex2asc.py

-> reads from stdin and writes to stdout

Run via shell script

Windows:

hex2asc.bat input.txt output.bin

Linux:

./hex2asc.sh input.txt output.bin

About

Python tool to convert ascii codes to hex (and back)

Resources

Stars

Watchers

Forks

Packages

No packages published