Skip to content

Commit

Permalink
Add more predifined runes for RandString (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiendc authored Dec 2, 2024
1 parent 6d7c038 commit bb4882b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion string.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ import (
var (
StrLowerAlpha = []rune("abcdefghijklmnopqrstuvwxyz")
StrUpperAlpha = []rune("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
StrAlpha = Concat(StrLowerAlpha, StrUpperAlpha)
StrDigits = []rune("0123456789")
StrDefaultChars = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
StrAlphaNumeric = Concat(StrAlpha, StrDigits)
StrSpecialChars = []rune("~!@#$%^&*()-_+`'\";:,.<>/?{[}]\\|")
StrAllChars = Concat(StrAlpha, StrDigits, StrSpecialChars)
StrDefaultChars = StrAlphaNumeric
)

// RandString generates a random string
Expand Down

0 comments on commit bb4882b

Please sign in to comment.