check message length in mnemonic encode
authorThomasV <thomasv@gitorious>
Tue, 3 Jun 2014 07:35:34 +0000 (09:35 +0200)
committerThomasV <thomasv@gitorious>
Tue, 3 Jun 2014 07:35:34 +0000 (09:35 +0200)
lib/mnemonic.py

index 82d2624..f5643ed 100644 (file)
@@ -1657,6 +1657,7 @@ n = 1626
 # Instead, the digit represented by a word is variable, it depends on the previous word.
 
 def mn_encode( message ):
+    assert len(message) % 8 == 0
     out = []
     for i in range(len(message)/8):
         word = message[8*i:8*i+8]