global-functions: $GetRandom20CharHex: add optional parameter for length

This commit is contained in:
Christian Hesse 2022-09-07 12:22:45 +02:00
parent a7f8aa95d0
commit ff0b05ea20

View file

@ -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