OSDN Git Service

fix bug
authorChengcheng Zhang <943420582@qq.com>
Mon, 14 Jan 2019 08:02:48 +0000 (16:02 +0800)
committerChengcheng Zhang <943420582@qq.com>
Mon, 14 Jan 2019 08:02:48 +0000 (16:02 +0800)
app/model/key.py
page3.html

index 88dc169..7fc1041 100644 (file)
@@ -41,9 +41,9 @@ def entropy_to_mnemonic(entropy_str):
     for _ in range(mnemonic_length):
         mnemonic_list.append('')
 
-    entropy_bytes = bytes.fromhex(entropy_str)
+    entropy_bytes = bytes.fromhex(entropy_str[:32])
     checksum = hashlib.sha256(entropy_bytes).hexdigest()[:1]
-    new_entropy_str = "0" + entropy_str + checksum
+    new_entropy_str = "0" + entropy_str[:32] + checksum
     new_entropy_bytes = bytes.fromhex(new_entropy_str)
     new_entropy_int = int.from_bytes(new_entropy_bytes, byteorder='big')
 
index 4e778e9..44f1e8b 100644 (file)
@@ -5,7 +5,7 @@
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <meta http-equiv="X-UA-Compatible" content="ie=edge">
-  <title>Bytom</title>
+  <title>Bytom Kit</title>
   <link rel="stylesheet" href="./node_modules/bootstrap/dist/css/bootstrap.min.css">
   <link rel="stylesheet" href="./assets/main.css">
   <script src="./node_modules/jquery/dist/jquery.min.js"></script>
@@ -17,7 +17,7 @@
 <body>
   <nav class="navbar navbar-default">
     <div class="navbar-header">
-      <a href="#" class="navbar-brand">Bytom</a>
+      <a href="#" class="navbar-brand">Bytom Kit</a>
     </div>
   </nav>
   <div class="panel panel-default sc-bd">