github.com/simpleiot/simpleiot@v0.18.3/test/hex.go (about)

     1  package test
     2  
     3  import "fmt"
     4  
     5  // HexDump provides a string of bytes in hex format
     6  func HexDump(data []byte) string {
     7  	ret := ""
     8  
     9  	for i, b := range data {
    10  		if i != 0 {
    11  			ret += " "
    12  		}
    13  		ret += fmt.Sprintf("%02x", b)
    14  	}
    15  
    16  	return ret
    17  }