Charsets
Charset defines an alphabet that can be used; mostly for generating structured strings. In Falbricate ecosystem, charset is basically an array of single-character strings.
Predefined charsets
There is already a set of charsets prepared for easier use:
numbers
(from interval[0, 9]
)lowercase
([a-z]
)uppercase
([A-Z]
)specials
(some of the special characters, like any of these:.,-?!:_$#&@=+-;*~/\|'"
)doubles
(double characters, like parentheses, brackets and so on)hexlower
(hexadecimal characters in lowercases)hexupper
(hexadecimal characters in uppercases)letters
(upper- and lowercase letters)alphanum
(uppercases, lowercases and numbers)alphanumspecs
(uppercases, lowercases, numbers and special characters)
Using charsets
Predefined charsets can be used at wide range of places through the Falbricate ecosystem, however the most common use-case is definitely when generating strings.
To demonstrate the usage, let's use the String of length Value Generator.
Examples
Here you can compare using predefined charsets with explicit declaration
Custom charsets
If your application requires a specific set of characters, you are free to define your own that meets the requirements.
Example
To define such charset, you only need to register it into the Falbricate ecosystem with following snippet:
Now, let's see the whole example:
Example
Note
There are some requirements your custom charset must meet:
-
Unique naming convention - name you specify must be unique through the whole ecosystem
-
Given charset must be a charset - the charset (as specified above) is considered to be an array of single-character strings; nothing else is allowed.