Skip to content

Instantly share code, notes, and snippets.

@mutatrum
Last active September 2, 2021 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mutatrum/9ecf578403c173148ac627ceaf256d5a to your computer and use it in GitHub Desktop.
Save mutatrum/9ecf578403c173148ac627ceaf256d5a to your computer and use it in GitHub Desktop.
Convert ChannelLink notation to hashed notation
#!/usr/bin/env node
var input = process.argv[2].split(':')
var result = (BigInt(input[0]) << 40n) + (BigInt(input[1]) << 16n) + (BigInt(input[2]))
console.log(result.toString())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment