mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-06-24 02:28:39 +02:00
global-functions: $GetRandom20CharHex: add optional parameter for length
This commit is contained in:
parent
a7f8aa95d0
commit
ff0b05ea20
1 changed files with 3 additions and 1 deletions
|
@ -402,7 +402,9 @@
|
||||||
|
|
||||||
# generate random 20 chars hex (0-9 and a-f)
|
# generate random 20 chars hex (0-9 and a-f)
|
||||||
:set GetRandom20CharHex do={
|
:set GetRandom20CharHex do={
|
||||||
:return [ :rndstr length=20 from="0123456789abcdef" ];
|
:global EitherOr;
|
||||||
|
|
||||||
|
:return [ :rndstr length=[ $EitherOr [ :tonum $1 ] 20 ] from="0123456789abcdef" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
# generate random number
|
# generate random number
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue