Last active
September 24, 2019 10:30
-
-
Save Hribek25/a0277aef161d2f2dcfbb021692be433d to your computer and use it in GitHub Desktop.
IOTA address and checksum
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The snippet is a part of the IOTA Developer Essentials project. You can reach it at https://hribek25.github.io/IOTA101/ | |
# Complete description and story behind the snippet is available at: https://hribek25.github.io/IOTA101/Allchapters_python.ipynb.html#39B011574CF0 | |
# Requirement: PyOTA library (!pip install pyota) | |
import iota | |
from pprint import pprint | |
# some IOTA address | |
Adr = iota.Address(b"CYJV9DRIE9NCQJYLOYOJOGKQGOOELTWXVWUYGQSWCNODHJAHACADUAAHQ9ODUICCESOIVZABA9LTMM9RW") | |
pprint("Original input excl. checksum address:") | |
pprint(Adr) | |
print("Length: %s" % len(Adr)) | |
AdrInclCheckSum = Adr.with_valid_checksum() | |
print("\nInput address including checksum:") | |
pprint(AdrInclCheckSum) # the last 9 trytes is the checksum | |
print("Length incl checksum: %s" % len(AdrInclCheckSum)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment