code: function inputComparator (aHash, aVout, bHash, bVout) {
    if (typeof aVout !== 'number' || typeof bVout !== 'number') throw new TypeError('Expected vouts of type Number')
    if (typeof aHash === 'string' && typeof bHash === 'string') {
      return aHash.localeCompare(bHash) || aVout - bVout
    }
  
    if (!Buffer.isBuffer(aHash) ||
        !Buffer.isBuffer(bHash)) throw new TypeError('Expected hashes of type Buffer')
  
    var aHashR = [].reverse.call(Buffer.from(aHash))
    var bHashR = [].reverse.call(Buffer.from(bHash))
    return aHashR.compare(bHashR) || aVout - bVout
  }
docs: Previous transaction hashes (in reversed byte-order) are to be sorted in ascending order, lexicographically. In the event of two matching transaction hashes, the respective previous output indices will be compared by their integer value, in ascending order. If the previous output indices match, the inputs are considered equal.