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
+9.6k Golang : Copy map(hash table) example
+37.7k Golang : Comparing date or timestamp
+26.1k Mac/Linux and Golang : Fix bind: address already in use error
+5.8k Golang : List all packages and search for certain package
+18.4k Golang : How to get hour, minute, second from time?
+6.2k Golang : Process non-XML/JSON formatted ASCII text file example
+6.3k Golang : Selection sort example
+12.5k Golang : Arithmetic operation with numerical slices or arrays example
+18k Golang : How to log each HTTP request to your web server?
+5.6k PHP : Convert string to timestamp or datestamp before storing to database(MariaDB/MySQL)
+29.1k Golang : Get first few and last few characters from string