MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / hex_to_bytes

Function hex_to_bytes

sdk/python/src/dstack_sdk/encrypt_env_vars.py:29–33  ·  view source on GitHub ↗

Convert hex string to bytes.

(hex_str: str)

Source from the content-addressed store, hash-verified

27
28
29def hex_to_bytes(hex_str: str) -> bytes:
30 """Convert hex string to bytes."""
31 if hex_str.startswith("0x"):
32 hex_str = hex_str[2:]
33 return bytes.fromhex(hex_str)
34
35
36def bytes_to_hex(data: bytes) -> str:

Callers 2

encrypt_env_varsFunction · 0.85
encrypt_env_vars_syncFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected