MCPcopy Create free account
hub / github.com/secdev/scapy / any2i

Method any2i

scapy/contrib/diameter.py:318–332  ·  view source on GitHub ↗
(self, pkt, x)

Source from the content-addressed store, hash-verified

316 return out
317
318 def any2i(self, pkt, x):
319 out = b''
320 if x:
321 fd = True # waiting for first digit
322 for c in x:
323 digit = orb(c) - 48
324 if fd:
325 val = digit
326 else:
327 val = val + 16 * digit
328 out += chb(val)
329 fd = not fd
330 if not fd: # Fill with 'f' if odd number of characters
331 out += chb(240 + val)
332 return out
333
334
335#####################################################################

Callers

nothing calls this directly

Calls 2

orbFunction · 0.90
chbFunction · 0.90

Tested by

no test coverage detected