mirror of
https://github.com/aljazceru/shurikenpi.io.git
synced 2025-12-17 22:24:23 +01:00
Add groundwork
This commit is contained in:
23
Tools/address_validation.py
Normal file
23
Tools/address_validation.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import sys
|
||||
import coinaddrvalidator
|
||||
|
||||
def help():
|
||||
print("Script to validate a bitcoin address")
|
||||
print("Usage: address_validation [bitcoin_address]")
|
||||
|
||||
if (len(sys.argv) != 2):
|
||||
print("Error: Too many argument or missing argument")
|
||||
print("Use -h to display help")
|
||||
exit(1)
|
||||
|
||||
if sys.argv[1] == "-h" or sys.argv[1] == "--help":
|
||||
help()
|
||||
exit(0)
|
||||
|
||||
address = sys.argv[1]
|
||||
|
||||
if coinaddrvalidator.validate('btc', address).valid == True:
|
||||
print("Address valid")
|
||||
exit(0)
|
||||
print("Address not valid")
|
||||
exit(1)
|
||||
Reference in New Issue
Block a user