github.com/TrueBlocks/trueblocks-core/src/apps/chifra@v0.0.0-20241022031540-b362680128f7/pkg/base/hex.go (about)

     1  package base
     2  
     3  import "encoding/hex"
     4  
     5  // Hex2Bytes duplicates the same-named function found in common, because we want to better control dependencies
     6  func Hex2Bytes(str string) []byte {
     7  	h, _ := hex.DecodeString(str)
     8  	return h
     9  }
    10  
    11  // Bytes2Hex duplicates the same-named function found in common, because we want to better control dependencies
    12  func Bytes2Hex(d []byte) string {
    13  	return hex.EncodeToString(d)
    14  }