Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created September 19, 2019 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/3ed6770c81a9e9890033e2e38506d32c to your computer and use it in GitHub Desktop.
Save parzibyte/3ed6770c81a9e9890033e2e38506d32c to your computer and use it in GitHub Desktop.
package main
import (
"crypto/rand"
"encoding/hex"
"fmt"
"io"
"log"
)
func main() {
// La longitud será el doble de la capacidad del arreglo (64 en este caso)
var clave [32]byte
_, err := io.ReadFull(rand.Reader, clave[:])
if err != nil {
log.Fatal(err)
}
fmt.Println("Clave => ", hex.EncodeToString(clave[:]))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment