1.4 KiB
1.4 KiB
title | description | menu | weight | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
hex.bytes() function | `hex.bytes()` converts a hexadecimal string to 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)