Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
IOTA address and checksum
// The snippet is a part of the IOTA Developer Essentials project. You can reach it at
// Complete description and story behind the snippet is available at:
// Requirement: A checksum module of IOTA Javascript Library (!npm install @iota/checksum)
var iotalib = require('@iota/checksum'); //this package is also useful when validating an address
//some IOTA address
console.log("Original input excl. checksum address:");
console.log("Length: %s", Adr.length)
var AdrInclCheckSum = iotalib.addChecksum(Adr); //generate checksum for the given address
console.log("Input address including checksum:")
console.log(AdrInclCheckSum) // the last 9 trytes is the checksum
console.log("Length incl checksum: %s", AdrInclCheckSum.length)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment