Skip to main content

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
}
[
"OVeXTRzBzNWCvlKPLr5dlaYorWz+5DCw",
"J+HK3VYQb46rnvd678yhHQb1iE+CgKiW",
"ooB/E3ALKOULu3/jLK1goKahOqnL0/Bh",
"41LJtG35U+dmUzCXVVZt1fabliXnDJxC",
"PLLxAfMcVfaUMf+j5e3EZX0eQtTeK9OS"
]

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
]
}
}
[
"+qVKgfA+DsLwgv4X0ULguZYDPYJSIjE=",
"vAZlxZ1BR2BId3moaQvi3H698CA9tXSy/gzrZlRU/igclgEDF8rQzGWgC4X3D7e5",
"02rLw7Xqv9IlS3+kNi2s2XmxamzLmCf8vT/Q",
"t1E1nXQYTwrX1fmKa1UAJtcdGCc=",
"s9rrvk/aioy7StjAXIEcVFTxRfgw"
]

Specification

JSON schema

{
"type": "object",
"properties": {
"size": {
"oneOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "object",
"properties": {
"_gen": {
"type": "string"
}
},
"required": [
"_gen"
]
}
]
}
},
"required": [
"size"
]
}