Update 'Zadanie3'
true/false dla reszty
This commit is contained in:
parent
c8a2112082
commit
2141c5b1f6
6
Zadanie3
6
Zadanie3
@ -47,6 +47,7 @@ def divide(message, poly16):
|
|||||||
|
|
||||||
def encode(message, poly16):
|
def encode(message, poly16):
|
||||||
|
|
||||||
|
|
||||||
l_poly16 = len(poly16)
|
l_poly16 = len(poly16)
|
||||||
|
|
||||||
# Dodajemy n-1 "0" do wiadomosci
|
# Dodajemy n-1 "0" do wiadomosci
|
||||||
@ -64,7 +65,10 @@ def decode(message2, poly16):
|
|||||||
l_poly16 = len(poly16)
|
l_poly16 = len(poly16)
|
||||||
appended_message2 = message2
|
appended_message2 = message2
|
||||||
remainder = divide(appended_message2, poly16)
|
remainder = divide(appended_message2, poly16)
|
||||||
print("reszta : ", remainder)
|
for i in range(0, len(remainder)):
|
||||||
|
if '1' not in remainder:
|
||||||
|
print("true ")
|
||||||
|
print("false ")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user