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
+7.5k Golang : Handling Yes No Quit query input
+5k Google : Block or disable caching of your website content
+11.2k Golang : Proper way to test CIDR membership of an IP 4 or 6 address example
+9.6k Golang : Validate IPv6 example
+12.1k Golang : convert(cast) string to integer value
+8.7k Golang : Combine slices but preserve order example
+13.7k Golang : Tutorial on loading GOB and PEM files
+10.1k Golang : Edge detection with Sobel method
+12.5k Golang : Forwarding a local port to a remote server example
+19.5k Golang : Example for DSA(Digital Signature Algorithm) package functions
+31.1k Golang : Calculate percentage change of two values
+4.6k MariaDB/MySQL : How to get version information