MCPcopy Create free account
hub / github.com/ICE27182/Python-3D-renderer / bytes_to_hex

Function bytes_to_hex

png.py:559–561  ·  view source on GitHub ↗

Take bytes type and return a string of hex in upper case, separated with space by 2 digits

(bytes:bytes, start:int=0)

Source from the content-addressed store, hash-verified

557
558
559def bytes_to_hex(bytes:bytes, start:int=0) -> str:
560 """Take bytes type and return a string of hex in upper case, separated with space by 2 digits"""
561 return " ".join(bytes[index + start : index + 1 + start].hex().upper() for index in range(len(bytes) - start))
562
563
564def print_bytes(bytes:bytes, start:int=0, group_size:int=4) -> None:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected