lbryschema.go/address/decode.go
Jack Robison c62c175d8b
more
2017-09-12 12:02:30 -04:00

18 lines
371 B
Go

package address
import (
"errors"
"./base58"
)
func DecodeAddress(address string) ([address_length]byte, error) {
decoded, err := base58.DecodeBase58(address, address_length)
if err != nil {
return [address_length]byte{}, errors.New("failed to decode")
}
buf := [address_length]byte{}
for i, b := range decoded {
buf[i] = b
}
return ValidateAddress(buf)
}