MCPcopy Create free account
hub / github.com/babel/minify / Bitfield

Class Bitfield

scripts/pyflate.py:63–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61 return (bytes << 3) + bits
62
63class Bitfield(BitfieldBase):
64 def _more(self):
65 c = self._read(1)
66 self.bitfield += ord(c) << self.bits
67 self.bits += 8
68 def snoopbits(self, n = 8):
69 if n > self.bits:
70 self.needbits(n)
71 return self.bitfield & self._mask(n)
72 def readbits(self, n = 8):
73 if n > self.bits:
74 self.needbits(n)
75 r = self.bitfield & self._mask(n)
76 self.bits -= n
77 self.bitfield >>= n
78 return r
79
80class RBitfield(BitfieldBase):
81 def _more(self):

Callers 1

gzip_mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected