Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'securerandom'
- require './ed25519.rb'
- require 'base32'
- def to_bin(data)
- [data].pack('H*')
- end
- def to_hex(data)
- data.unpack('H*')
- end
- def ripe_md_mod(pk)
- Digest::RMD160.hexdigest(to_bin(Digest::SHA3.hexdigest(pk,256)))
- end
- hash = "68" + ripe_md_mod(publickey(to_bin(SecureRandom.hex 32).reverse))
- checksum = Digest::SHA3.hexdigest(to_bin(hash),256)[0..7]
- puts Base32.encode to_bin(hash + checksum)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement