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

Method encodeValue

pager_lib/pyasn1/codec/ber/encoder.py:170–183  ·  view source on GitHub ↗
(self, value, asn1Spec, encodeFun, **options)

Source from the content-addressed store, hash-verified

168 supportCompactZero = False
169
170 def encodeValue(self, value, asn1Spec, encodeFun, **options):
171 if value == 0:
172 if LOG:
173 LOG('encoding %spayload for zero INTEGER' % (
174 self.supportCompactZero and 'no ' or ''
175 ))
176
177 # de-facto way to encode zero
178 if self.supportCompactZero:
179 return (), False, False
180 else:
181 return (0,), False, False
182
183 return to_bytes(int(value), signed=True), False, True
184
185
186class BitStringEncoder(AbstractItemEncoder):

Callers

nothing calls this directly

Calls 1

to_bytesFunction · 0.90

Tested by

no test coverage detected