misc

command
v0.0.0-...-15eb78e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2022 License: AGPL-3.0 Imports: 4 Imported by: 0

README

Misc Tools

Collection of various tools that are useful enough to save, but niche enough that they don't belong in goal.

convertAddress

It's sometimes useful to convert addresses between the public "Stripped Base32 /w checksum" format, and the Base64 encoded 32 byte format. This tool converts the two formats.

There is only very minor error checking, results from this tool to not ensure valid inputs.

# Address to Base64 encoded bytes.
~$ go run convertAddress.go -addr E33YVTQNYH2BHI33OCYL7JQQSEMXD4EN74CZQ37FC6EZFHIBCNWOWXIZ5M
JveKzg3B9BOje3Cwv6YQkRlx8I3/BZhv5ReJkp0BE2w=

# Base64 encoded bytes to Address.
~$ go run convertAddress.go -addr JveKzg3B9BOje3Cwv6YQkRlx8I3/BZhv5ReJkp0BE2w=
E33YVTQNYH2BHI33OCYL7JQQSEMXD4EN74CZQ37FC6EZFHIBCNWOWXIZ5M

If you want to run it more than once, it may be useful to compile a binary rather than building with go run on each invokation:

# Build binary.
~$ go build convertAddress.go

# Use binary.
~$ ./convertAddress -addr JveKzg3B9BOje3Cwv6YQkRlx8I3/BZhv5ReJkp0BE2w=
E33YVTQNYH2BHI33OCYL7JQQSEMXD4EN74CZQ37FC6EZFHIBCNWOWXIZ5M

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL