docs-v2/content/flux/v0.x/stdlib/universe/bytes.md

1.3 KiB

title description menu weight flux/v0.x/tags introduced
bytes() function `bytes()` converts a string value to a bytes type.
flux_0_x_ref
name parent identifier
bytes universe universe/bytes
101
type-conversions
0.40.0

bytes() converts a string value to a bytes type.

Function type signature
(v: A) => bytes

{{% caption %}}For more information, see Function type signatures.{{% /caption %}}

Parameters

v

({{< req >}}) Value to convert.

Examples

Convert a string to bytes

bytes(v: "Example string")// Returns 0x4578616d706c6520737472696e67