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

Tree @master (Download .tar.gz)

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

#!/usr/bin/env python3

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

# SPDX-FileCopyrightText: Chris Pressey, the original author of this work, has dedicated it to the public domain.
# For more information, please refer to <https://unlicense.org/>
# SPDX-License-Identifier: Unlicense

import sys

while True:
    byte = sys.stdin.read(1)
    if len(byte) < 1:
        sys.exit(0)
    sys.stdout.write('%02x' % ord(byte))