fixed self issue

This commit is contained in:
Kevin Froman 2018-04-25 01:56:40 -05:00
parent 6b9d4f8fc6
commit 1e32446f2a
3 changed files with 21 additions and 2 deletions

View file

@ -161,6 +161,17 @@ class API:
time.sleep(self._privateDelayTime - elapsed)
return resp
@app.route('/')
def banner():
self.mimeType = 'text/html'
self.validateHost('public')
try:
with open('static-data/index.html', 'r') as html:
resp = Response(html.read())
except FileNotFoundError:
resp = Response("")
return resp
@app.route('/public/')
def public_handler():

View file

@ -174,8 +174,10 @@ class OnionrCrypto:
public_key = private_key.verify_key.encode(encoder=nacl.encoding.Base32Encoder())
return (public_key.decode(), private_key.encode(encoder=nacl.encoding.Base32Encoder()).decode())
def pubKeyHashID(self, pubkey=self.pubKey):
def pubKeyHashID(self, pubkey=''):
'''Accept a ed25519 public key, return a truncated result of X many sha3_256 hash rounds'''
if pubkey == '':
pubkey = self.pubKey
prev = ''
pubkey = pubkey.encode()
for i in range(self.HASH_ID_ROUNDS):