From ff0b05ea20b4448a2c21d9550fd6ec2adeda41a9 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 7 Sep 2022 12:22:45 +0200 Subject: global-functions: $GetRandom20CharHex: add optional parameter for length --- global-functions | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3-54-g00ecf