NativeRest, in addition to variables, supports various helper functions, such as hash sums,
random number generation, encoding and decoding in Base64 format, mathematical operations,
date and time formatting, and many others.
All supported functions are located in the Functions panel at the bottom.
Use the Ctrl + Click shortcut to jump to
the function declaration in the Functions panel.
All functions are divided into the following groups:
- random
- string
- hash
- hmac
- base64
- date
- math
The function panel allows you to test functions without sending a request to the server.
Functions, like variables, can be embedded in requests fields using double curly braces
{{}}.
Using parameters in functions
Constants, variables, and other functions may be passed as function parameters.
Using a constant in a function parameter
{{random.integer(1000)}}
โ
789
Using a variable in a function parameter
{{string.toUpperCase({{random.email}})}}
โ
ALEX@HOTMAIL.COM
Using a function in a function parameter
{{string.length({{base64.encode(123)}})}}
โ
4
Supported functions
In NativeRest, functions can have 1, 2, or 3 parameters. A comma is used as a parameter separator.
In the examples below, the underscore _ is used to indicate the number of parameters.
Random functions
random.integer(_)
random.range(_, _)
random.uuid(_)
Hash functions
Hash functions don't have the hash prefix.
To use them, simply specify the name of the hash function
(md5, sha256, etc.).
md5(_)
sha1(_)
sha224(_)
sha256(_)
sha384(_)
sha512(_)
HMAC hash functions
hmac.sha224(_, _)
hmac.sha256(_, _)
hmac.sha384(_, _)
hmac.sha512(_, _)
Base64 Encode and Decode functions
base64.encode(_)
base64.decode(_)
DateTime functions
Function date.format formats the current date and time.
See date and time format specifiers.
date.format(_)
Math functions
math.round(_)
math.ceil(_)
math.floor(_)
math.trunc(_)
math.inc(_)
math.dec(_)
math.add(_, _)
math.sub(_, _)
math.mul(_, _)
math.div(_, _)
String functions
string.length(_)
string.toUpperCase(_)
string.toLowerCase(_)
string.substring(_, _, _)
string.replace(_, _, _)
string.repeat(_, _)
string.trim(_)
Date Time Format strings are composed of specifiers that represent values
to be inserted into the formatted string.
Case is ignored in formats, except for the "am/pm" and "a/p" specifiers.
Specifier |
Displays |
d |
Displays the day as a number without a leading zero (1-31). |
dd |
Displays the day as a number with a leading zero (01-31). |
ddd |
Displays the day as an abbreviation (Sun-Sat). |
dddd |
Displays the day as a full name (Sunday-Saturday). |
m |
Displays the month as a number without a leading zero (1-12). If the m specifier immediately follows an h or hh specifier, the minute rather than the month is displayed. |
mm |
Displays the month as a number with a leading zero (01-12). If the mm specifier immediately follows an h or hh specifier, the minute rather than the month is displayed. |
mmm |
Displays the month as an abbreviation (Jan-Dec). |
mmmm |
Displays the month as a full name (January-December). |
yy |
Displays the year as a two-digit number (00-99). |
yyyy |
Displays the year as a four-digit number (0000-9999). |
h |
Displays the hour without a leading zero (0-23). |
hh |
Displays the hour with a leading zero (00-23). |
n |
Displays the minute without a leading zero (0-59). |
nn |
Displays the minute with a leading zero (00-59). |
s |
Displays the second without a leading zero (0-59). |
ss |
Displays the second with a leading zero (00-59). |
z |
Displays the millisecond without a leading zero (0-999). |
zzz |
Displays the millisecond with a leading zero (000-999). |
am/pm |
Uses the 12-hour clock for the preceding h or hh specifier, and displays 'am' for any hour before noon, and 'pm' for any hour after noon. The am/pm specifier can use lower, upper, or mixed case, and the result is displayed accordingly. |
a/p |
Uses the 12-hour clock for the preceding h or hh specifier, and displays 'a' for any hour before noon, and 'p' for any hour after noon. The a/p specifier can use lower, upper, or mixed case, and the result is displayed accordingly. |
ampm |
Uses the 12-hour clock for the preceding h or hh specifier, and displays the contents of the TimeAMString global variable for any hour before noon, and the contents of the TimePMString global variable for any hour after noon. |
/ |
Displays the date separator character. |
: |
Displays the time separator character. |
'xx'/"xx" |
Characters enclosed in single or double quotation marks are displayed as such, and do not affect formatting. |
For example, to display the current date and time (hours and minutes), you can use the following syntax:
{{date.format(yyyy-mm-dd hh:nn)}}
โ
2025-09-28 12:05