diff options
-rw-r--r-- | global-functions | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/global-functions b/global-functions index 14b045e..654642e 100644 --- a/global-functions +++ b/global-functions @@ -416,18 +416,9 @@ } :global GetRandom20CharHex; + :global HexToNum; - :local Num; - :local 40CharHex ([ $GetRandom20CharHex ] . [ $GetRandom20CharHex ]); - - :for I from=0 to=39 do={ - :local Char [ :pick $40CharHex $I ]; - :if ($Char~"[0-9]") do={ - :set Num ($Num . $Char); - } - } - - :return ([ :tonum [ :pick $Num 0 18 ] ] % $Max); + :return ([ $HexToNum [ :pick [ $GetRandom20CharHex ] 0 15 ] ] % $Max); } # convert from hex (string) to num |