Skip to content

jpegleg/h2b2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# h2b2
Convert hex to binary text with h2b2, a simple lookup table program with piped input.
h2b2 <<< 7975700a

Or you could just try to send things to it:

/your/things/and/stuff | h2b2

Example with output:

openssl rand -hex 128 | h2b2
0100101101001000100011011110010001010101011001001010100001011010111010010111110000101100100011111110001001001100111010100000011000010001101001010000000111101011000110100110100101110101000111100000001001000000010011111011111100101111001000011011100100010110011110011110101001110111011110100100101111010100001001111100000100001000110101110001110001111101011001101001000001111011101011100100111111101010001011111110111001011100010100111010110000000100110111110110110000101000001111111001100111110101100001111100100000011010101010100000111101101111111111011110100000011101100011101101100101010111100000010100100001100101001010011111010100011000011011010101101110001011010010011000110100001110000110111011010011001100010110011000111010101111010001111001001011010000111100011101010000101011000011110100101010111011100000010111001010110001010011100011000000100101000001110101011110000000101110010011000010011010111000011110011000001100011011101111101010001000001100000110011111001010010010100001001111110110101010101001100011100111



But it will segfault if you put too much in at once:

openssl rand -hex 1005 | h2b2
Segmentation fault

1004 is the max that can be used in that scenario.
This limit is intentionally coded into the program. Modify as desired if you need larger numbers.
Chunking the hex input if larger than 1000 is the intended design there.
Example of a larger data set being chunked up into pieces for h2b2.
openssl rand -hex 9999999999 | fold -c1000 | while read line; do echo $line | h2b2; done


About

Convert hex to binary text

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published