github.com/aergoio/aergo@v1.3.1/types/common.go (about) 1 package types 2 3 import ( 4 "encoding/base64" 5 6 "github.com/mr-tron/base58/base58" 7 ) 8 9 const MAXBLOCKNO BlockNo = 18446744073709551615 10 11 func EncodeB64(bs []byte) string { 12 return base64.StdEncoding.EncodeToString(bs) 13 } 14 15 func DecodeB64(sb string) []byte { 16 buf, _ := base64.StdEncoding.DecodeString(sb) 17 return buf 18 } 19 20 func EncodeB58(bs []byte) string { 21 return base58.Encode(bs) 22 } 23 24 func DecodeB58(sb string) []byte { 25 buf, _ := base58.Decode(sb) 26 return buf 27 }