aboutsummaryrefslogtreecommitdiffstats
path: root/global-functions
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2022-09-07 12:22:45 +0200
committerGravatar Christian Hesse <mail@eworm.de>2022-09-07 12:22:45 +0200
commitff0b05ea20b4448a2c21d9550fd6ec2adeda41a9 (patch)
treee8a65c1fff707f417e2fca528fe8da2b722b734b /global-functions
parenta7f8aa95d0bb676e47023cd8afecbf8dafcec176 (diff)
global-functions: $GetRandom20CharHex: add optional parameter for length
Diffstat (limited to 'global-functions')
-rw-r--r--global-functions4
1 files changed, 3 insertions, 1 deletions
diff --git a/global-functions b/global-functions
index ad9f39e..f02da9e 100644
--- a/global-functions
+++ b/global-functions
@@ -402,7 +402,9 @@
# generate random 20 chars hex (0-9 and a-f)
:set GetRandom20CharHex do={
- :return [ :rndstr length=20 from="0123456789abcdef" ];
+ :global EitherOr;
+
+ :return [ :rndstr length=[ $EitherOr [ :tonum $1 ] 20 ] from="0123456789abcdef" ];
}
# generate random number