commit 274c67f9847fd1f3683bf9f0308af158d1ca4d69
parent 30b608c6fb0f837de9211c43900d436742d3d882
Author: ThomasV <thomasv@gitorious>
Date: Tue, 3 Jun 2014 09:35:34 +0200
check message length in mnemonic encode
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/lib/mnemonic.py b/lib/mnemonic.py
@@ -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]