aboutsummaryrefslogtreecommitdiff
path: root/http_handle_login.go
diff options
context:
space:
mode:
Diffstat (limited to 'http_handle_login.go')
-rw-r--r--http_handle_login.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/http_handle_login.go b/http_handle_login.go
index b43e133..f45db80 100644
--- a/http_handle_login.go
+++ b/http_handle_login.go
@@ -77,6 +77,9 @@ func handle_login(w http.ResponseWriter, r *http.Request, params map[string]any)
http.Redirect(w, r, "/", http.StatusSeeOther)
}
+// random_urlsafe_string generates a random string of the given entropic size
+// using the URL-safe base64 encoding. The actual size of the string returned
+// will be 4*sz.
func random_urlsafe_string(sz int) (string, error) {
r := make([]byte, 3*sz)
_, err := rand.Read(r)