<< Click to Display Table of Contents >> Navigation: 3. Script Language > String commands > !STR.- String Command > String Operations |
MiniRobotLanguage (MRL)
STR.Make Pad
Generate a highly random number
Intention
MAKE PAD has the same Syntax like GENERATE RANDOM STRING - but uses internally another PRNG (Pseudo Random Number Generator) with a Periode length of about 2^60 which is in numbers (rough estimation) 1152921504000000000 before the sequence will repeat. Therefore the result should be safe for cryptographic uses.
This Mode will generate a random String of specified length and from specified characters. You can use it to generate passwords.
For generation of Tables with random numbers in the full ASC-Range), cryptographical random numbers and "One Time Pads" prefer other options, for example the CHAR D - Option.
The command itself looks like this:
STR.MAKE PAD|$$SRC|$$CNT|$$CHR
And here is a small example:
: $$TXT=ABC
: $$NUM=5
STR.MAKE PAD|$$SRC|$$NUM|$$TXT
MBX.$$SRC
Which will bring up a Message-Box like this ..
Pic.1 Result from:
STR.MAKE PAD|$$SRC|$$NUM|$$TXT
and a Message-Box like this:
Pic.2 Result from:
STR.MAKE PAD|$$SRC
Syntax
STR.MAKE PAD|P1[|P2][|P3]
Parameter Explanation
P1 - source and destination variable
P2 - (optional) length of desired random string in bytes. If omitted, a default length of 32 byte length is used.
P3 - (optional) variable with all characters that should be used for the random string generation.
Alternatively you can use some small letters to define the character-Set for P3.
- empty/if P3 is omitted, then the whole charset from 255 ASC-Characters will be used.
"a" - all ASC-Character (0-255)
"b" - "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-?#+*"
"c" - "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-?"
"d" - "abcdefghijklmnopqrstuvwxyzöüäßABCDEFGHIJKLMNOPQRSTUVWXYZÄÜÖ"
"e" - "abcdefghijklmnopqrstuvwxyz"
"f" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"g" - "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZüöäÜÖÄß'[]{}@|<>.1234567890_\-;:*+#§%&/()=! "
"h" - "0123456789ABCDEF"
"i" - "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZüöäÜÖÄß'´`[]{}@.1234567890_-;+#§%&()=! "
"k" - ":\abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZüöäÜÖÄß'[]{}@.1234567890_-;+#§%&()=! "
"m" - "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.1234567890_\ "
"o" - "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"
"n" - "0123456789"
"p" - "\/:*?<>|"+ASC(34) (Double-Quotes)
"x" - "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZüöäÜÖÄß[]{}@<>.1234567890_\-;:*+#§%&/()=!"
Example
'*************************************
' STR.MAKE PAD
'*************************************
: $$TXT=ABC
: $$NUM=5
STR.MAKE PAD|$$SRC|$$NUM|$$TXT
MBX.$$SRC
STR.MAKE PAD|$$SRC
MBX.$$SRC
ENR.
Remarks
While we have made any effort to produce PRNG's of highest quality, there is no warranty whatever, that these randomly generated strings are safe for use with cryptographic or safety software, or even for password-generation on a specific computer-hardware. Use them on your own risk.
Limitations:
-
See also:
• 1.5.2 Working with Text-Strings
• VAR. - Variable Set Value/Clear
• IVS. / NVS. - If-Variable-String
• SBD. - String between Delimiter
• SBM. - String between Delimiter-Multiple