github.com/aergoio/aergo@v1.3.1/internal/enc/bstr.go (about)

     1  package enc
     2  
     3  import "github.com/mr-tron/base58/base58"
     4  
     5  // ToString returns human-readable (base58) string from b. Calling with empty or nil slice returns empty string.
     6  func ToString(b []byte) string {
     7  	return base58.Encode(b)
     8  }
     9  
    10  // ToBytes returns byte slice from human-readable (base58) string. Calling with empty string returns zero length string error.
    11  func ToBytes(s string) ([]byte, error) {
    12  	return base58.Decode(s)
    13  }