RandomString

RandomString

Generates random string with a random size between [min, max] using either the default character set: a-zA-Z0-9 or a custom set as specified with the 'characters' parameter

Attributes
Name Description Required Min Max Allowed Values
seed Random number generator seed of this Element. Overrides default seeding behavior. no 0 1
name (Class)Name of this element. Used to identify plugin Class. Full name is required. Example: com.en.myPluginPackage.myPuginClass no 0 1
id Identification String of this element. May be used to uniquely identify a field within the children of an Element. no 0 1
Nodes
Name Description Required Min Max Allowed Values
max Content type: Long
Maximum number of characters to generate (inclusive).
yes 1 1
characters Content type: String
Sets characters this generator uses for generating a random string
no 0 1
min Content type: Long
Minimum number of characters to generate (inclusive). Default: 0
no 0 1

Examples

  1. Random String

    Generates a random alphanumeric string of random length between 0 (default) and 16 characters.

    Schema config for Random String
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!--
    /*******************************************************************************
    * Copyright (c) 2013, bankmark and/or its affiliates. All rights reserved.
    * bankmark UG PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
    ******************************************************************************/
    --><schema xmlns:doc="http://bankmark.de/pdgf/doc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="demo" xsi:noNamespaceSchemaLocation="structure/pdgfSchema.xsd">
      <!-- All data is derived from this starting seed.
           If this seed is the same, the generated data will the same on each
           computer/node/platform.
           Change this seed to generate a different data set.-->
      <seed>1234567890L</seed>
    
      <rng name="PdgfDefaultRandom"/>
    
      <!--Default Scale factor for all tables -->
      <property name="SF" type="double">1</property>
    
      <table name="RANDOM_STRINGS">
        <!-- if tables should scale with -SF command line argument.
             Specify your scaling formula here: -->
        <size>10 * ${SF}</size>
    
        <!--Random String-->
          <!--Generates a random alphanumeric string of random length between 0 (default) and 16 characters.-->
          <field name="rand_string" size="" type="NUMERIC">
            <gen_RandomString>
              <max>16</max>
            </gen_RandomString>
          </field>
        </table>
    </schema>
    
    Output for Random String
    oRPeblZedUfvCM
    4
    qc66hNIE
    FSputj
    sKAmguZ9Gof8EQX
    2LMxFHM237sBNi
    ARsMElDMH5UCvo
    yhLw7
    D6
    k
  2. Random String with Minimum Length

    Generates a random alphanumeric string of random length between 2 and 4 characters.

    Schema config for Random String with Minimum Length
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!--
    /*******************************************************************************
    * Copyright (c) 2013, bankmark and/or its affiliates. All rights reserved.
    * bankmark UG PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
    ******************************************************************************/
    --><schema xmlns:doc="http://bankmark.de/pdgf/doc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="demo" xsi:noNamespaceSchemaLocation="structure/pdgfSchema.xsd">
      <!-- All data is derived from this starting seed.
           If this seed is the same, the generated data will the same on each
           computer/node/platform.
           Change this seed to generate a different data set.-->
      <seed>1234567890L</seed>
    
      <rng name="PdgfDefaultRandom"/>
    
      <!--Default Scale factor for all tables -->
      <property name="SF" type="double">1</property>
    
      <table name="RANDOM_STRINGS">
        <!-- if tables should scale with -SF command line argument.
             Specify your scaling formula here: -->
        <size>10 * ${SF}</size>
    
        <!--Random String with Minimum Length-->
          <!--Generates a random alphanumeric string of random length between 2 and 4 characters.-->
          <field name="rand_string_min" size="" type="NUMERIC">
            <gen_RandomString>
              <min>2</min>
              <max>4</max>
            </gen_RandomString>
          </field>
          </table>
    </schema>
    
    Output for Random String with Minimum Length
    6nDv
    bV
    2G
    MM
    BRhc
    YjQG
    Mkm
    5cu
    eKzj
    oS
  3. Random Word

    Generates a random character string containing only characters 'a' to 'z' of random length between 3 and 12 characters.

    Schema config for Random Word
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!--
    /*******************************************************************************
    * Copyright (c) 2013, bankmark and/or its affiliates. All rights reserved.
    * bankmark UG PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
    ******************************************************************************/
    --><schema xmlns:doc="http://bankmark.de/pdgf/doc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="demo" xsi:noNamespaceSchemaLocation="structure/pdgfSchema.xsd">
      <!-- All data is derived from this starting seed.
           If this seed is the same, the generated data will the same on each
           computer/node/platform.
           Change this seed to generate a different data set.-->
      <seed>1234567890L</seed>
    
      <rng name="PdgfDefaultRandom"/>
    
      <!--Default Scale factor for all tables -->
      <property name="SF" type="double">1</property>
    
      <table name="RANDOM_STRINGS">
        <!-- if tables should scale with -SF command line argument.
             Specify your scaling formula here: -->
        <size>10 * ${SF}</size>
    
        <!--Random Word-->
          <!--
            Generates a random character string containing only characters 'a' to 'z' of random length between 3 and 12
            characters.
          -->
          <field name="rand_word" size="" type="NUMERIC">
            <gen_RandomString>
              <min>3</min>
              <max>12</max>
              <characters>abcdefghijklmnopqrstuvwxyz</characters>
            </gen_RandomString>
          </field>
          </table>
    </schema>
    
    Output for Random Word
    ksolgnqppjz
    qhpzkuyyf
    loflluduqpx
    hwdjp
    cayg
    yeygvm
    twxrgcwvziw
    fgqwz
    iuzemkc
    ipezgefeh
  4. Random Hexadecimal-String

    Generates a random hexadecimal string of length 16.

    Schema config for Random Hexadecimal-String
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!--
    /*******************************************************************************
    * Copyright (c) 2013, bankmark and/or its affiliates. All rights reserved.
    * bankmark UG PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
    ******************************************************************************/
    --><schema xmlns:doc="http://bankmark.de/pdgf/doc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="demo" xsi:noNamespaceSchemaLocation="structure/pdgfSchema.xsd">
      <!-- All data is derived from this starting seed.
           If this seed is the same, the generated data will the same on each
           computer/node/platform.
           Change this seed to generate a different data set.-->
      <seed>1234567890L</seed>
    
      <rng name="PdgfDefaultRandom"/>
    
      <!--Default Scale factor for all tables -->
      <property name="SF" type="double">1</property>
    
      <table name="RANDOM_STRINGS">
        <!-- if tables should scale with -SF command line argument.
             Specify your scaling formula here: -->
        <size>10 * ${SF}</size>
    
        <!--Random Hexadecimal-String-->
          <!--Generates a random hexadecimal string of length 16.-->
          <field name="rand_hex_string" size="" type="NUMERIC">
            <gen_RandomString>
              <min>16</min>
              <max>16</max>
              <characters>0123456789abcdef</characters>
            </gen_RandomString>
          </field>
          </table>
    </schema>
    
    Output for Random Hexadecimal-String
    22690d0d5594d196
    e7f924682edfd0a3
    36f39cd2e89903b7
    f6d798d705b5f8c0
    2a2076ceee525deb
    288a5cce374fab6c
    10ff60e56424d0ad
    3680302351896dba
    c834a427b97cdb34
    27edaef4bb3abf77
2.6_#1486_b758 | 2016-05-24