From cd90c3ddf3f06320e34c75d39244588282f4f94a Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Sun, 6 Oct 2024 17:00:49 +0200 Subject: [PATCH] Update randNum function and documentation for multiple versions Expanded randNum function comments to provide detailed behavior and usage across different Go versions. Enhanced the randomStringSecure function doc to explain its cryptographic secure implementation and error handling. --- random.go | 29 ++++++++++++++++++++++++----- random_119.go | 12 +++++++++++- random_121.go | 12 +++++++++++- random_122.go | 12 ++++++++++-- 4 files changed, 56 insertions(+), 9 deletions(-) diff --git a/random.go b/random.go index 3a3f16b..2478c75 100644 --- a/random.go +++ b/random.go @@ -14,14 +14,33 @@ import ( const cr = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" // Bitmask sizes for the string generators (based on 93 chars total) +// +// These constants define bitmask-related values used for efficient random string generation. +// The bitmask operates over 93 possible characters, and the constants help determine the +// number of bits and indices used in the process. const ( - letterIdxBits = 7 // 7 bits to represent a letter index - letterIdxMask = 1<