import { startsWith } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/bytes/index.js";
Checks if the byte array starts with the given prefix.
Examples
Example 1
Example 1
import { startsWith } from "@ayonli/jsext/bytes";
const arr = new Uint8Array([1, 2, 3, 4, 5]);
console.log(startsWith(arr, new Uint8Array([1, 2]))); // true
console.log(startsWith(arr, new Uint8Array([2, 1]))); // false