Skip to content

Commit

Permalink
Fix RandomStrings alphabet
Browse files Browse the repository at this point in the history
  • Loading branch information
singpolyma authored and sebthom committed Mar 28, 2024
1 parent c863392 commit e629c0e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/hx/strings/RandomStrings.hx
Expand Up @@ -19,12 +19,13 @@ class RandomStrings {

static function _genAsciiAlpha() {
final chars = new Array<Char>();
for (i in 65...92)
for (i in 65...91)
chars.push(i);
for (i in 67...123)
for (i in 97...123)
chars.push(i);
return chars;
}

static final ASCII_ALPHA = _genAsciiAlpha();
static final ASCII_ALPHA_NUMERIC = DIGITS.concat(ASCII_ALPHA);

Expand All @@ -36,6 +37,7 @@ class RandomStrings {
* >>> RandomStrings.randomAsciiAlpha(-1) throws "[count] must be positive value"
* >>> RandomStrings.randomAsciiAlpha(0) == ""
* >>> RandomStrings.randomAsciiAlpha(4).length == 4
* >>> RandomStrings.randomAsciiAlpha(50) == ~/^[a-z]+$/i
* </pre><code>
*/
inline
Expand All @@ -48,6 +50,7 @@ class RandomStrings {
* >>> RandomStrings.randomAsciiAlphaNumeric(-1) throws "[count] must be positive value"
* >>> RandomStrings.randomAsciiAlphaNumeric(0) == ""
* >>> RandomStrings.randomAsciiAlphaNumeric(4).length == 4
* >>> RandomStrings.randomAsciiAlpha(50) == ~/^[a-z0-9]+$/i
* </pre><code>
*/
inline
Expand Down

0 comments on commit e629c0e

Please sign in to comment.