Skip to content

Instantly share code, notes, and snippets.

@scalone
Created March 19, 2015 03:34
Show Gist options
  • Save scalone/d1e28a03da8788ebffae to your computer and use it in GitHub Desktop.
Save scalone/d1e28a03da8788ebffae to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"encoding/hex"
)
func main() {
sample1 := "\xbd\xb2\x3d\xbc\x20\xe2\x8c\x98"
str := "30bdb23dbc20e28c98"
fmt.Printf("hello, world\n")
b, err := hex.DecodeString(str)
fmt.Printf("Str %s \n", sample1)
fmt.Printf("Hex %s \n", str)
fmt.Printf("Err %s \n", err)
fmt.Printf("Byte %s \n", b)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment