Scalar functions
bytes
Commentary
added in 0.3.20
Generates random byte arrays of the specified size, which is mainly useful for increasing event size in performance testing.
Examples
Generating bytes
Use a constant to generate byte arrays of the same size.
{
"_gen": "bytes",
"size": 24
}
[
"vmphqpoMYRe9Z0Pn3JeFc5mOaF6IXLNh",
"+GyXRiC+v7ARALJ2VFcYww9AbMjjoYj/",
"8RBZ62+85iZV371vg7iWcNbZ+b9S2D3u",
"3Av2YgWDXMwWrWgtjEeKJvRQJ5hJWZtW",
"3VOzNRpXK0Dyf3LTfzR7XZl5Fiz6lZ0o"
]
Varied sizes
Use a function to generate byte arrays of varying sizes, in this case between 10 and 50 bytes.
{
"_gen": "bytes",
"size": {
"_gen": "uniformDistribution",
"bounds": [
10,
50
]
}
}
[
"vWdD59yXhXOZjmheiFyzYQ==",
"EQCydlRXGMMPQGzI46GI",
"Vd+9b4O4lnDW2fm/Utg97twL9mIFg1zMFq1oLYxHiib0UCeYSQ==",
"8n9y0380e12ZeRYs+pWd",
"l+lTwAJsxKResy+Sgp6NFO6CfJTtyTUX732kwM4pcsybBgsItkYIUfOjoFuxAvcy"
]
Specification
JSON schema
{
"type": "object",
"properties": {
"size": {
"oneOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "object",
"properties": {
"_gen": {
"type": "string"
}
},
"required": [
"_gen"
]
}
]
}
},
"required": [
"size"
]
}