Module:RNG/doc

From The Wiki Camp 2
Jump to navigation Jump to search

This is the documentation page for Module:RNG

basically a few functions that deal with randomness and random text

how 2 random

this module contains five functions, which each generate random strings with different sets of characters:

  • number - generates a random number
  • alphabet - generates a random string using only letters
  • alphanumeric - generates a random string using uppercase and lowercase letters, and numbers
  • symbols - generates a random string using only symbols and punctuation
  • string - generates a random string using any characters

this module can be called like so:

{{#invoke: RNG | (function name) | (length) | (case (alphabet function only))}}

the alphabet function has an additional parameter, used for determining the case of the letters.

  • when case is set to upper, letters will always be uppercase.
  • when case is set to lower, letters will always be lowercase.
  • when case is set to both (or anything else), case will be random.

randomness from this module is cached, meaning the user will have to refresh the page while ignoring cache (ctrl + f5) in order to reroll for new values.

examples

{{#invoke: RNG | number | 6}} will result in a random six digit number: 374955

{{#invoke: RNG | alphabet | 8 | upper}} will result in a random 8 letter string in all caps: XnQRffnL

{{#invoke: RNG | alphanumeric | 15}} will result in a random 15 character string, with numbers and letters: Th1j1ZNpp6fg041

{{#invoke: RNG | symbols | 5}} will result in a random 5 character string with only symbols and punctuation: |/','

{{#invoke: RNG | string | 20}} will result in a Password: v5{p!9^`9:Y"ab}q70(@