You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
442B

  1. package zcashrpc
  2. import "encoding/hex"
  3. // Hex encapsulates behaviour related to zcash hex encoding of certain fields like memo and keys
  4. type Hex string
  5. // MakeHex converts a string into a zcash-compatible hex string
  6. func MakeHex(input string) Hex {
  7. return Hex(hex.EncodeToString([]byte(input)))
  8. }
  9. // Decode returns the raw byte representation of a hex-string
  10. func (h Hex) Decode() ([]byte, error) {
  11. return hex.DecodeString(string(h))
  12. }