Golang encoding/hex.Dump() function example
package encoding/hex
Dump returns a string that contains a hex dump of the given data. The format of the hex dump matches the output of
hexdump -C
on the command line.
Golang encoding/hex.Dump() function usage example
package main
import (
"encoding/hex"
"fmt"
)
func main() {
str := []byte("abcd")
fmt.Println(hex.Dump(str))
}
Output :
00000000 61 62 63 64 |abcd|
Reference :
Advertisement
Something interesting
Tutorials
+13.4k Golang : Increment string example
+7.5k Golang : Rot13 and Rot5 algorithms example
+8.6k Golang : Add text to image and get OpenCV's X, Y co-ordinates example
+20.2k Golang : Compare floating-point numbers
+6.9k Golang : Fibonacci number generator examples
+18.7k Unmarshal/Load CSV record into struct in Go
+25.7k Golang : missing Mercurial command
+17.9k Golang : Login and logout a user after password verification and redirect example
+18k Golang : Get all upper case or lower case characters from string example
+8.6k Golang : Convert(cast) []byte to io.Reader type
+37.7k Golang : Comparing date or timestamp