MCPcopy Create free account
hub / github.com/btcsuite/btcd / hexEncode

Function hexEncode

txscript/template.go:191–193  ·  view source on GitHub ↗

hexEncode is a helper function to encode bytes to hex in templates. It adds the "0x" prefix to ensure the output is processed as hex data and not misinterpreted as an integer.

(data []byte)

Source from the content-addressed store, hash-verified

189// It adds the "0x" prefix to ensure the output is processed as hex data
190// and not misinterpreted as an integer.
191func hexEncode(data []byte) string {
192 return "0x" + hex.EncodeToString(data)
193}
194
195// hexStr is a helper function to encode bytes to a raw hex string in templates
196// without the "0x" prefix.

Callers 1

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…