MCPcopy
hub / github.com/fortra/impacket / to_ary

Method to_ary

impacket/wps.py:61–72  ·  view source on GitHub ↗
(self, value0)

Source from the content-addressed store, hash-verified

59 return reduce( lambda ac, x: ac * 256 + x, ary, 0)
60
61 def to_ary(self, value0):
62 value = value0
63 rv = array.array('B')
64 for _ in range(self.size):
65 value, mod = divmod(value, 256)
66 rv.append(mod)
67
68 if value != 0:
69 raise Exception("%s is too big. Max size: %s" % (value0, self.size))
70
71 rv.reverse()
72 return rv
73
74class TLVContainer(object):
75

Callers 1

appendMethod · 0.45

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected