mirror of
https://github.com/librekeys/pycvc.git
synced 2026-04-14 08:44:08 -07:00
02a4b5348c
Cleaned up the bits_test and added asserts Also added utility to convert arbitrary files to hexstring
20 lines
440 B
Python
20 lines
440 B
Python
import binascii
|
|
import argparse
|
|
|
|
|
|
def file_to_hex(filename):
|
|
with open(filename, "rb") as f:
|
|
content = f.read()
|
|
print(binascii.hexlify(content))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
parser = argparse.ArgumentParser(
|
|
description="Helper util to convert CVCert(or any file) to hex string"
|
|
)
|
|
parser.add_argument("file", help="File to convert to hex")
|
|
|
|
args = parser.parse_args()
|
|
|
|
file_to_hex(args.file)
|