Exemplo n.º 1
0
 def _block_callback(
     self,
     outbuf: binwrapper.BinWrapper,
     data: bytes,
 ) -> None:
     outbuf.write_bytes(b'D')
     outbuf.write_bytes(hashlib.sha1(data).digest())
     outbuf.write_len32_prefixed_bytes(data)
Exemplo n.º 2
0
 def dump(self, val: str, buffer: binwrapper.BinWrapper) -> None:
     buffer.write_len32_prefixed_bytes(val.encode('utf-8'))
Exemplo n.º 3
0
 def dump(self, val: bytes, buffer: binwrapper.BinWrapper) -> None:
     buffer.write_len32_prefixed_bytes(val)