Skip to main content

Random Integer

Goal

Write mask rule logic to

  • generate random integers from an interval defined by <from> and <to> properties

Ano Structure and Examples

        ...
mask <column> <rule-name>
format %d
random-integer <from> <to> // Includes from and to
...
  • <from> and <to> values are included in the generated values.
  • If desired result is differs from integer, simply change the format string.
    • For strings, simply format with double quoutes "%d", and the generated integers would become strings.

Limits

  • random-integer uses java.lang.Integer. Values can thus only be generated from the range [-2147483648, 2147483647], i.e., 9-10 digit numbers.

Workaround

  • If a larger (positive or negative) value than the allowed range is sought, then use multiple 'random-integer' together, and concatenate them inside a string, as per the example above.