docs-v2/content/flux/v0/stdlib/contrib/bonitoo-io/hex/bytes.md

1.4 KiB

title description menu weight
hex.bytes() function `hex.bytes()` converts a hexadecimal string to bytes.
flux_v0_ref
name parent identifier
hex.bytes contrib/bonitoo-io/hex contrib/bonitoo-io/hex/bytes
301

hex.bytes() converts a hexadecimal string to bytes.

Function type signature
(v: string) => bytes

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

Parameters

v

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

Examples

Convert a hexadecimal string into bytes

import "contrib/bonitoo-io/hex"

hex.bytes(v: "FF5733")// Returns [255 87 51] (bytes)