MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / fromHexString

Method fromHexString

pager_lib/pyasn1/type/univ.py:911–930  ·  view source on GitHub ↗

Create a |ASN.1| object initialized from the hex string. Parameters ---------- value: :class:`str` Text string like 'DEADBEEF'

(value)

Source from the content-addressed store, hash-verified

909
910 @staticmethod
911 def fromHexString(value):
912 """Create a |ASN.1| object initialized from the hex string.
913
914 Parameters
915 ----------
916 value: :class:`str`
917 Text string like 'DEADBEEF'
918 """
919 r = []
920 p = []
921 for v in value:
922 if p:
923 r.append(int(p + v, 16))
924 p = None
925 else:
926 p = v
927 if p:
928 r.append(int(p + '0', 16))
929
930 return bytes(r)
931
932 # Immutable sequence object protocol
933

Callers 1

__init__Method · 0.95

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected