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
+6.5k Golang : Spell checking with ispell example
+17.4k Golang : Get future or past hours, minutes or seconds
+16.4k Golang : How to implement two-factor authentication?
+9k Golang : How to use Gorilla webtoolkit context package properly
+17.6k Convert JSON to CSV in Golang
+20.2k Golang : Convert seconds to human readable time format example
+26.7k Golang : How to check if a connection to database is still alive ?
+8.4k Your page has meta tags in the body instead of the head
+7.1k Golang : Get environment variable
+20.6k Nginx + FastCGI + Go Setup.
+14.6k Golang : Reset buffer example
+6.6k Golang : How to validate ISBN?