Created
September 19, 2019 18:16
-
-
Save parzibyte/3ed6770c81a9e9890033e2e38506d32c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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