forked from kalmar/DALGLI0
Update 'Zadanie3'
This commit is contained in:
parent
1dc92f3872
commit
9c6a607f34
4
Zadanie3
4
Zadanie3
@ -87,8 +87,12 @@ def decode(message,crc):
|
||||
l_poly16 = len(poly16)
|
||||
message = bytearray(message, 'ascii')
|
||||
message = format(int.from_bytes(message, "big"), "b")
|
||||
while len(message) % 8 != 0:
|
||||
message = "0" + message
|
||||
dec = int(crc, 16)
|
||||
crc2=bin(dec)[2:]
|
||||
while len(crc2) % 8 != 0:
|
||||
crc2 = "0" + crc2
|
||||
msg=message+crc2
|
||||
while len(msg) % 8 != 0:
|
||||
msg = "0" + msg
|
||||
|
Loading…
Reference in New Issue
Block a user