From dd95e2dbfad7f39060dc70f145d0e1478770e454 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Tue, 18 Feb 2025 10:23:44 +0800 Subject: *.go: Add some comments for docs --- http_handle_login.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'http_handle_login.go') 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) -- cgit v1.2.3