ethereumjs-monorepo

@ethereumjs/util


@ethereumjs/util / matchingBitsLength

Function: matchingBitsLength()

matchingBitsLength(bits1, bits2): number

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

Compares two arrays of bits (0 or 1) and returns the count of consecutively matching bits from the start.

Parameters

bits1

number[]

The first array of bits, in bytes or bits.

bits2

number[]

The second array of bits, in bytes or bits.

Returns

number

The count of consecutively matching bits from the start.