ethereumjs-monorepo

@ethereumjs/util


@ethereumjs/util / matchingBytesLength

Function: matchingBytesLength()

matchingBytesLength(bytes1, bytes2): number

Defined in: packages/util/src/bytes.ts:546

Compares two byte arrays and returns the count of consecutively matching items from the start.

Parameters

bytes1

Uint8Array

The first Uint8Array to compare.

bytes2

Uint8Array

The second Uint8Array to compare.

Returns

number

The count of consecutively matching items from the start.