@oazmi/kitchensink - v0.9.13
    Preparing search index...

    Function hexStringToArray

    • convert hex-string back to an array of integers, provided that you know the exact HexStringReprConfig config of your particular hex-string.

      this function performs the inverse operation of hexStringOfArray, given that you use the same options.

      Parameters

      Returns number[]

      import { assertEquals as assertEq } from "jsr:@std/assert"

      const
      my_binary_code_repr = "<0x01,0x02,0x03,0x7D,0x7E,0x7F,0xC0,0xE1,0xFF,>",
      my_custom_config: Partial<HexStringReprConfig> = {
      sep: ",",
      trailingSep: true,
      bra: "<",
      ket: ">",
      }

      const my_binary_code: number[] = hexStringToArray(my_binary_code_repr, my_custom_config)

      assertEq(my_binary_code, [1, 2, 3, 125, 126, 127, 192, 225, 255])