diff options
author | Christian Hesse <mail@eworm.de> | 2022-09-07 12:28:45 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2022-09-07 12:28:45 +0200 |
commit | 8f32887a1ac2e844072a4ff41b17f8f5de04b6b2 (patch) | |
tree | 99a07b16ed528eebb27980041e45e9683d3e3b77 /global-functions | |
parent | ff0b05ea20b4448a2c21d9550fd6ec2adeda41a9 (diff) |
global-functions: introduce $GetRandom20CharAlNum
Diffstat (limited to 'global-functions')
-rw-r--r-- | global-functions | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/global-functions b/global-functions index f02da9e..5bbe7c4 100644 --- a/global-functions +++ b/global-functions @@ -28,6 +28,7 @@ :global EscapeForRegEx; :global FlushEmailQueue; :global GetMacVendor; +:global GetRandom20CharAlNum; :global GetRandom20CharHex; :global GetRandomNumber; :global HexToNum; @@ -400,6 +401,13 @@ } } +# generate random 20 chars alphabetical (A-Z & a-z) and numerical (0-9) +:set GetRandom20CharAlNum do={ + :global EitherOr; + + :return [ :rndstr length=[ $EitherOr [ :tonum $1 ] 20 ] from="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" ]; +} + # generate random 20 chars hex (0-9 and a-f) :set GetRandom20CharHex do={ :global EitherOr; |