MCPcopy Create free account
hub / github.com/cryptidtech/oberon / _decode_bytes

Function _decode_bytes

python/oberon/bindings.py:40–50  ·  view source on GitHub ↗
(arg: Optional[Union[str, bytes, FfiByteBuffer]])

Source from the content-addressed store, hash-verified

38
39
40def _decode_bytes(arg: Optional[Union[str, bytes, FfiByteBuffer]]) -> bytes:
41 if isinstance(arg, FfiByteBuffer):
42 return string_at(arg.data, arg.length)
43 if isinstance(arg, memoryview):
44 return string_at(arg.obj, arg.nbytes)
45 if isinstance(arg, bytearray):
46 return arg
47 if arg is not None:
48 if isinstance(arg, str):
49 return arg.encode("utf-8")
50 return bytearray()
51
52
53def _encode_bytes(arg: Optional[Union[str, bytes, FfiByteBuffer]]) -> FfiByteBuffer:

Callers 7

new_secret_keyFunction · 0.85
get_public_keyFunction · 0.85
secret_key_from_seedFunction · 0.85
new_tokenFunction · 0.85
add_blindingFunction · 0.85
remove_blindingFunction · 0.85
create_proofFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected