Skip to content

Instantly share code, notes, and snippets.

@ProTip
Created January 26, 2014 06:11
Show Gist options
  • Save ProTip/8629184 to your computer and use it in GitHub Desktop.
Save ProTip/8629184 to your computer and use it in GitHub Desktop.
nounce_slice := message[len(message)-8:]
var nounce_window uint64
hdrp := (*reflect.SliceHeader)(unsafe.Pointer(&nounce_window))
hdrp.Data = (*reflect.SliceHeader)(unsafe.Pointer(&nounce_slice)).Data
hdrp.Len = 1
hdrp.Cap = 1
nounce_window = 10
fmt.Println(nounce_window, nounce_slice)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment