Files
Björn Benouarets f509f6e524 feat: add utility functions and helpers
- Add JWT token generation and validation utilities
- Add password hashing with bcrypt for secure authentication
- Add pagination helper for API responses
- Add random string generation for tokens and IDs
- Add session management utilities
- Add admin user initialization functionality
2025-09-25 23:24:18 +02:00

14 lines
214 B
Go

package utils
import (
"math/rand"
)
func GenerateRandomString(length int) string {
bytes := make([]byte, length)
for i := 0; i < length; i++ {
bytes[i] = byte(rand.Intn(26) + 97)
}
return string(bytes)
}