code: function MerkleTree(leaves, hashAlgorithm, options) {
          if (options === void 0) { options = {}; }
          this.hashAlgo = bufferifyFn(hashAlgorithm);
          this.leaves = leaves.map(bufferify);
          this.layers = [this.leaves];
          this.isBitcoinTree = !!options.isBitcoinTree;
          this.createHashes(this.leaves);
      }
docs: @desc Constructs a Merkle Tree.
  All nodes and leaves are stored as Buffers.
  Lonely leaf nodes are promoted to the next level up without being hashed again.
  @param {Buffer[]} leaves - Array of hashed leaves. Each leaf must be a Buffer.
  @param {Function} hashAlgorithm - Algorithm used for hashing leaves and nodes
  @param {Object} options - Additional options
  @param {Boolean} options.isBitcoinTree - If set to `true`, constructs the Merkle
  Tree using the [Bitcoin Merkle Tree implementation](http://www.righto.com/2014/02/bitcoin-mining-hard-way-algorithms.html). Enable it when you need
  to replicate Bitcoin constructed Merkle Trees. In Bitcoin Merkle Trees, single nodes are combined with themselves, and each output hash is hashed again.
  @example
  const MerkleTree = require('merkletreejs')
  const crypto = require('crypto')
  
  function sha256(data) {
  // returns Buffer
  return crypto.createHash('sha256').update(data).digest()
  }
  
  const leaves = ['a', 'b', 'c'].map(x => sha3(x))
  
  const tree = new MerkleTree(leaves, sha256)