package core:encoding/hex
Overview
Encoding and decoding of hex-encoded binary, e.g. 0x23 -> #.
Index
Types (0)
This section is empty.
Constants (0)
This section is empty.
Variables (0)
This section is empty.
Procedure Groups (0)
This section is empty.
Types
This section is empty.
Constants
This section is empty.
Variables
This section is empty.
Procedures
decode ¶
decode :: proc(src: []u8, allocator := context.allocator, loc := #caller_location) -> (dst: []u8, ok: bool) {…}
Decodes a hex sequence into a byte slice
Allocates Using Provided Allocator
Inputs:
dst: The hex sequence decoded into bytes
src: The []byte to be hex-decoded
allocator: (default: context.allocator)
loc: The caller location for debugging purposes (default: #caller_location)
Returns:
ok: A bool, true if decoding succeeded, false otherwise
decode_sequence ¶
Decodes the first byte in a hex sequence to a byte
Inputs:
str: A hex-encoded string, e.g. "0x23"
Returns:
res: The decoded byte, e.g. '#'
ok: A bool, true if decoding succeeded, false otherwise
encode ¶
encode :: proc(src: []u8, allocator := context.allocator, loc := #caller_location) -> (res: []u8, err: runtime.Allocator_Error) #optional_ok {…}
Encodes a byte slice into a lowercase hex sequence
Allocates Using Provided Allocator
Inputs:
src: The []byte to be hex-encoded
allocator: (default: context.allocator)
loc: The caller location for debugging purposes (default: #caller_location)
Returns:
res: The hex-encoded result
err: An optional allocator error if one occured, .None otherwise
encode_into_writer ¶
Encodes a byte slice as a lowercase hex sequence into an io.Writer
Inputs:
dst: The io.Writer to encode into
src: The []byte to be hex-encoded
Returns:
err: An io.Error if one occured, .None otherwise
encode_upper ¶
encode_upper :: proc(src: []u8, allocator := context.allocator, loc := #caller_location) -> (res: []u8, err: runtime.Allocator_Error) #optional_ok {…}
Encodes a byte slice into an uppercase hex sequence
Allocates Using Provided Allocator
Inputs:
src: The []byte to be hex-encoded
allocator: (default: context.allocator)
loc: The caller location for debugging purposes (default: #caller_location)
Returns:
res: The hex-encoded result
err: An optional allocator error if one occured, .None otherwise
encode_upper_into_writer ¶
Encodes a byte slice as an uppercase hex sequence into an io.Writer
Inputs:
dst: The io.Writer to encode into
src: The []byte to be hex-encoded
Returns:
err: An io.Error if one occured, .None otherwise
Procedure Groups
This section is empty.
Source Files
Generation Information
Generated with odin version dev-2026-02 (vendor "odin") Windows_amd64 @ 2026-02-15 21:16:13.100310100 +0000 UTC