diff options
Diffstat (limited to 'global-functions')
-rw-r--r-- | global-functions | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/global-functions b/global-functions index 01c9160..cd8342b 100644 --- a/global-functions +++ b/global-functions @@ -407,15 +407,9 @@ # generate random number :set GetRandomNumber do={ - :local Max 4294967295; - :if ([ :typeof $1 ] != "nothing" ) do={ - :set Max ([ :tonum $1 ] + 1); - } - - :global GetRandom20CharHex; - :global HexToNum; + :global EitherOr; - :return ([ $HexToNum [ :pick [ $GetRandom20CharHex ] 0 15 ] ] % $Max); + :return [ :rndnum from=0 to=[ $EitherOr [ :tonum $1 ] 4294967295 ] ]; } # convert from hex (string) to num |