function toUint8Array(hex) {
        const pairs = hex.match(/[\dA-F]{2}/gi);
        if (!pairs) throw new Error("Invalid hex");
        return new Uint8Array(
          pairs.map((s) => parseInt(s, 16)) // convert to integers
        );
      }
/**
       * Converts an hex string to Uint8Array
       */
Converts an hex string to Uint8Array
Converts an hex string to Uint8Array
function toUint8Array(hex) {
        const pairs = hex.match(/[\dA-F]{2}/gi);
        if (!pairs) throw new Error("Invalid hex");
        return new Uint8Array(
          pairs.map((s) => parseInt(s, 16)) 
        );
      }
function toUint8Array ( hex ) { const pairs = hex . match ( / [\dA-F]{2} / gi ) ; if ( ! pairs ) throw new Error ( "Invalid hex" ) ; return new Uint8Array ( pairs . map ( ( s ) => parseInt ( s , 16 ) ) ) ; }
Converts an hex string to Uint8Array
Converts an hex string to Uint8Array
// convert to integers