Onionr/onionr/httpapi/onionrsitesapi/findsite.py
2019-09-28 00:37:24 -05:00

10 lines
310 B
Python

import onionrexceptions
from onionrutils import mnemonickeys
from onionrutils import stringvalidators
def find_site(user_id: str)->str:
if '-' in user_id: user_id = mnemonickeys.get_base32(user_id)
if not stringvalidators.validate_pub_key(user_id): raise onionrexceptions.InvalidPubkey
#for