MCPcopy Create free account
hub / github.com/e2wugui/zeze / write_uint_size

Method write_uint_size

python/zeze/buffer.py:277–286  ·  view source on GitHub ↗
(v)

Source from the content-addressed store, hash-verified

275
276 @staticmethod
277 def write_uint_size(v):
278 # v看成无符号数时,与write_ulong_size的结果一致,即相当于write_ulong_size(v & 0xffff_ffff)
279 # @formatter:off
280 v &= 0xffff_ffff
281 if v < 0x80: return 1
282 if v < 0x4000: return 2
283 if v < 0x20_0000: return 3
284 if v < 0x1000_0000: return 4
285 return 5
286 # @formatter:on
287
288 def write_uint(self, v):
289 # v看成无符号数时,与write_ulong的结果一致,即相当于write_ulong(v & 0xffff_ffff)

Callers 1

check_uintMethod · 0.80

Calls

no outgoing calls

Tested by 1

check_uintMethod · 0.64