compare(a, b) {

        let first_key = this.keys[0]
        let first_type = this.types[first_key]

        let valA = a[first_key]
        let valB = b[first_key]

        if(first_type.compare)
            return first_type.compare(valA, valB)

        if(typeof valA === "number" && typeof valB === "number")
            return valA - valB

        let encoding
        if(Buffer.isBuffer(valA) && Buffer.isBuffer(valB)) {
            // A binary string compare does not work.  If localeCompare is well supported that could replace HEX.  Performanance is very good so comparing HEX works.
            encoding = "hex"
        }

        let strA = valA.toString(encoding)
        let strB = valB.toString(encoding)
        return strA > strB ? 1 : strA < strB ? -1 : 0
    }
Sort by the first element in a operation