Skip to content
This repository has been archived by the owner on Sep 10, 2019. It is now read-only.

Commit

Permalink
Remove bitcoin import that exposes confusing functions (#170)
Browse files Browse the repository at this point in the history
* update dependencies

* Remove bitcoin import that results in exposing misleading functions

* fix local tests

* linting..
  • Loading branch information
ixje committed Mar 7, 2019
1 parent eae43cb commit b2ce968
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions neocore/Cryptography/Helper.py
Expand Up @@ -5,8 +5,6 @@
Usage:
from neocore.Cryptography.Helper import *
"""

from bitcoin import *
import os
import time
import random
Expand All @@ -19,6 +17,14 @@
ADDRESS_VERSION = 23


def random_key():
# Gotta be secure after that java.SecureRandom fiasco...
entropy = str(os.urandom(32)) + str(random.randrange(2 ** 256)) + str(int(time.time() * 1000000))
binary_data = bytes(entropy, 'utf-8')
x = hashlib.sha256(binary_data).digest()
return binascii.hexlify(x)


def double_sha256(ba):
"""
Perform two SHA256 operations on the input.
Expand Down
1 change: 1 addition & 0 deletions neocore/Cryptography/MerkleTree.py
@@ -1,3 +1,4 @@
import sys
from .Crypto import *
from neocore.UInt256 import UInt256

Expand Down

0 comments on commit b2ce968

Please sign in to comment.