tuweni / org.apache.tuweni.kademlia / kotlin.ByteArray / xorDistCmp

xorDistCmp

fun ByteArray.xorDistCmp(a: ByteArray, b: ByteArray): Int (source)

Compare two equal-length byte arrays for their XOR-distance to this.

Parameters

a - the first byte array

b - the second byte array

Exceptions

IllegalArgumentException - if a or b are not the same length as this

Return
-1 if a is closer, +1 if b is closer, or 0 if they are the same distance to this