git @ Cat's Eye Technologies Falderal / master script / fa-hex-to-bin
master

Tree @master (Download .tar.gz)

fa-hex-to-bin @masterraw · history · blame

#!/usr/bin/env python3

# converts hex couples on input to raw bytes on output.

import sys

while True:
    hex = sys.stdin.read(2)
    if len(hex) < 2:
        sys.exit(0)
    sys.stdout.write(chr(int(hex, 16)))