Skip to content

Instantly share code, notes, and snippets.

@schollz
schollz / main.go
Created June 25, 2018 02:11 — forked from dopey/main.go
How to generate secure random strings in golang with crypto/rand.
package main
import (
"crypto/rand"
"encoding/base64"
"fmt"
"io"
)
// Adapted from https://elithrar.github.io/article/generating-secure-random-numbers-crypto-rand/