core/encoding/hex

encoding_hex

Procedures

6

decode

decode :: proc(src: []u8, allocator: mem.Allocator = context.allocator, loc = #caller_location) -> (dst: []u8, ok: bool)Source

Decodes a hex sequence into a byte slice

Allocates Using Provided Allocator

  • 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)
  • ok: A bool, true if decoding succeeded, false otherwise

encode

encode :: proc(src: []u8, allocator: mem.Allocator = context.allocator, loc = #caller_location) -> (res: []u8, err: runtime.Allocator_Error)Source

Encodes a byte slice into a lowercase hex sequence

Allocates Using Provided Allocator

  • src: The []byte to be hex-encoded
  • allocator: (default: context.allocator)
  • loc: The caller location for debugging purposes (default: #caller_location)
  • res: The hex-encoded result
  • err: An optional allocator error if one occured, .None otherwise

encode_upper

encode_upper :: proc(src: []u8, allocator: mem.Allocator = context.allocator, loc = #caller_location) -> (res: []u8, err: runtime.Allocator_Error)Source

Encodes a byte slice into an uppercase hex sequence

Allocates Using Provided Allocator

  • src: The []byte to be hex-encoded
  • allocator: (default: context.allocator)
  • loc: The caller location for debugging purposes (default: #caller_location)
  • res: The hex-encoded result
  • err: An optional allocator error if one occured, .None otherwise

Reference search

Find anything

Documentation preferences

Settings

System theme variants

Used only while Theme is set to System.