Пример #1
0
 def hash(sketchSalt: bytes, packet: VerificationPacket) -> int:
     return int.from_bytes(blake2b(sketchSalt + packet.serialize(),
                                   digest_size=8).digest(),
                           byteorder="big")
Пример #2
0
 def packet(self, packet: VerificationPacket) -> bytes:
     res: bytes = (MessageType.VerificationPacket.toByte() +
                   packet.serialize())
     self.send(res)
     return res