function bufferEqual(a, b) {
    if (typeof a.equals === "function") {
        return a.equals(b);
    }
    if (a.length !== b.length) {
        return false;
    }
    for (let i = 0; i < a.length; ++i) {
        if (a[i] !== b[i]) {
            return false;
        }
    }
    return true;
}
Test if two buffers are equal

@export
@param {Buffer} a
@param {Buffer} b
@returns {boolean} Whether the two buffers are equal