[{"name":"Hex","comment":" Convert between `Bytes` and hexadecimal strings.\n\n  - [`fromBytes`](#fromBytes) encodes `Bytes` into a lowercase hex `String`.\n  - [`toBytes`](#toBytes) decodes a hex `String` (mixed-case) into `Bytes`, with validation.\n  - [`toBytesUnchecked`](#toBytesUnchecked) decodes a lowercase hex `String` into `Bytes`, without validation.\n\n@docs fromBytes, toBytes, toBytesUnchecked\n\n","unions":[],"aliases":[],"values":[{"name":"fromBytes","comment":" Convert `Bytes` to a lowercase hex string.\n\n    import Bytes.Encode as Encode\n\n    Encode.encode (Encode.unsignedInt8 255)\n        |> fromBytes\n    --> \"ff\"\n\n","type":"Bytes.Bytes -> String.String"},{"name":"toBytes","comment":" Parse a hex string into `Bytes`. Returns `Nothing` if the string has\nodd length or contains non-hex characters. Accepts both uppercase and\nlowercase hex digits.\n\n    toBytes \"ff\"\n    --> Just <1 byte>\n\n    toBytes \"zz\"\n    --> Nothing\n\n","type":"String.String -> Maybe.Maybe Bytes.Bytes"},{"name":"toBytesUnchecked","comment":" Parse a lowercase hex string into `Bytes`. Does not validate the input:\nassumes even length and only lowercase hex characters (0-9, a-f).\nAbout 20% faster than [`toBytes`](#toBytes).\n\n    toBytesUnchecked \"ff\"\n    --> <1 byte>\n\n","type":"String.String -> Bytes.Bytes"}],"binops":[]},{"name":"XBytes","comment":" Comparable byte sequences backed by a hex string.\n\n`XBytes` is an opaque type that wraps a lowercase hex `String`.\nUnlike `Bytes`, two `XBytes` values can be compared with `==`.\n\n\n# Hex conversion\n\n@docs XBytes\n@docs fromHex, fromHexUnchecked, toHex\n\n\n# Bytes conversion\n\n@docs fromBytes, toBytes\n\n\n# Text conversion\n\n@docs fromText, toText\n\n\n# Common operations\n\n@docs empty, isEmpty, width\n@docs reverse, append, concat, join\n@docs slice, left, right, dropLeft, dropRight\n\n\n# Bytes.Decode / Bytes.Encode interop\n\n@docs decoder, encode\n\n\n# JSON\n\n@docs jsonEncode, jsonDecoder\n\n","unions":[{"name":"XBytes","comment":" An opaque byte sequence backed by a lowercase hex string.\nSupports structural equality via `==`.\n","args":[],"cases":[]}],"aliases":[],"values":[{"name":"append","comment":" Append two byte sequences.\n\n    toHex (append (fromHexUnchecked \"dead\") (fromHexUnchecked \"beef\"))\n        == \"deadbeef\"\n\n","type":"XBytes.XBytes -> XBytes.XBytes -> XBytes.XBytes"},{"name":"concat","comment":" Concatenate a list of byte sequences.\n\n    toHex (concat [ fromHexUnchecked \"de\", fromHexUnchecked \"ad\" ])\n        == \"dead\"\n\nUses `List.foldl` with `(++)` instead of `List.map` + `String.concat`\nto avoid allocating an intermediate `List String`. Benchmarked 63% faster.\n\n","type":"List.List XBytes.XBytes -> XBytes.XBytes"},{"name":"decoder","comment":" Run a `Bytes.Decode.Decoder` on the underlying bytes.\n\n    decode Bytes.Decode.unsignedInt8 (fromHexUnchecked \"ff\") == Just 255\n\n","type":"Bytes.Decode.Decoder a -> XBytes.XBytes -> Maybe.Maybe a"},{"name":"dropLeft","comment":" Drop the first `n` bytes.\n\n    toHex (dropLeft 1 (fromHexUnchecked \"deadbeef\")) == \"adbeef\"\n\n","type":"Basics.Int -> XBytes.XBytes -> XBytes.XBytes"},{"name":"dropRight","comment":" Drop the last `n` bytes.\n\n    toHex (dropRight 1 (fromHexUnchecked \"deadbeef\")) == \"deadbe\"\n\n","type":"Basics.Int -> XBytes.XBytes -> XBytes.XBytes"},{"name":"empty","comment":" An empty byte sequence.\n\n    toHex empty == \"\"\n\n","type":"XBytes.XBytes"},{"name":"encode","comment":" Run a `Bytes.Encode.Encoder` and wrap the result as `XBytes`.\n\n    toHex (encode (Bytes.Encode.unsignedInt8 255)) == \"ff\"\n\n","type":"Bytes.Encode.Encoder -> XBytes.XBytes"},{"name":"fromBytes","comment":" Convert `Bytes` to `XBytes`.\n","type":"Bytes.Bytes -> XBytes.XBytes"},{"name":"fromHex","comment":" Create `XBytes` from a hex string, validating the input.\nReturns `Nothing` if the string has odd length or contains non-hex characters.\n\n    fromHex \"deadbeef\"\n        == Just\n        ... fromHex \"nope\"\n        == Nothing\n\nUses a validate-only pass (no intermediate Bytes allocation) followed by\na single `String.toLower` call. Benchmarked 25-43% faster than routing\nthrough `Hex.toBytes` which allocates Encoder nodes and Bytes just to\ndiscard them.\n\n","type":"String.String -> Maybe.Maybe XBytes.XBytes"},{"name":"fromHexUnchecked","comment":" Create `XBytes` from a lowercase hex string without validation.\nThe caller must ensure the input is a valid, even-length, lowercase hex string.\n","type":"String.String -> XBytes.XBytes"},{"name":"fromText","comment":" Encode a UTF-8 `String` as `XBytes`.\n\n    toHex (fromText \"A\") == \"41\"\n\n","type":"String.String -> XBytes.XBytes"},{"name":"isEmpty","comment":" Check if the byte sequence is empty.\n\n    isEmpty empty == True\n\n","type":"XBytes.XBytes -> Basics.Bool"},{"name":"join","comment":" Join a list of byte sequences with a separator.\n\n    toHex (join (fromHexUnchecked \"00\") [ fromHexUnchecked \"aa\", fromHexUnchecked \"bb\" ])\n        == \"aa00bb\"\n\n","type":"XBytes.XBytes -> List.List XBytes.XBytes -> XBytes.XBytes"},{"name":"jsonDecoder","comment":" Decode a JSON string as `XBytes`, validating hex content.\nFails if the string is not valid hex.\n","type":"Json.Decode.Decoder XBytes.XBytes"},{"name":"jsonEncode","comment":" Encode `XBytes` as a JSON string (lowercase hex).\n","type":"XBytes.XBytes -> Json.Encode.Value"},{"name":"left","comment":" Take the first `n` bytes.\n\n    toHex (left 2 (fromHexUnchecked \"deadbeef\")) == \"dead\"\n\n","type":"Basics.Int -> XBytes.XBytes -> XBytes.XBytes"},{"name":"reverse","comment":" Reverse the byte order.\n\n    toHex (reverse (fromHexUnchecked \"0102\")) == \"0201\"\n\n","type":"XBytes.XBytes -> XBytes.XBytes"},{"name":"right","comment":" Take the last `n` bytes.\n\n    toHex (right 2 (fromHexUnchecked \"deadbeef\")) == \"beef\"\n\n","type":"Basics.Int -> XBytes.XBytes -> XBytes.XBytes"},{"name":"slice","comment":" Slice bytes from index `start` (inclusive) to `end` (exclusive).\nIndices are byte offsets, following the same semantics as `String.slice`.\n\n    toHex (slice 1 3 (fromHexUnchecked \"deadbeef\")) == \"adbe\"\n\n","type":"Basics.Int -> Basics.Int -> XBytes.XBytes -> XBytes.XBytes"},{"name":"toBytes","comment":" Convert `XBytes` to `Bytes`.\n","type":"XBytes.XBytes -> Bytes.Bytes"},{"name":"toHex","comment":" Extract the lowercase hex string from `XBytes`.\n\n    toHex (fromHexUnchecked \"deadbeef\") == \"deadbeef\"\n\n","type":"XBytes.XBytes -> String.String"},{"name":"toText","comment":" Decode `XBytes` as a UTF-8 `String`.\nReturns `Nothing` if the bytes are not valid UTF-8.\n\n    toText (fromHexUnchecked \"41\") == Just \"A\"\n\n","type":"XBytes.XBytes -> Maybe.Maybe String.String"},{"name":"width","comment":" The number of bytes.\n\n    width (fromHexUnchecked \"deadbeef\") == 2\n\n","type":"XBytes.XBytes -> Basics.Int"}],"binops":[]}]