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
+14.4k Golang : Fix cannot use buffer (type bytes.Buffer) as type io.Writer(Write method has pointer receiver) error
+41.3k Golang : How to check if a string contains another sub-string?
+20.5k Golang : Count number of digits from given integer value
+10.7k Golang : cannot assign type int to value (type uint8) in range error
+12.2k Golang : Convert(cast) bigint to string
+4.9k MariaDB/MySQL : How to get version information
+16.8k Golang : Get IP addresses of a domain name
+34.3k Golang : Proper way to set function argument default value
+9.4k Golang : Intercept and compare HTTP response code example
+6.7k Golang : How to search a list of records or data structures
+15k Golang : GUI with Qt and OpenCV to capture image from camera
+25.5k Golang : Storing cookies in http.CookieJar example