encode = async (entry, encryptEntryFn, encryptPayloadFn) => {
  const e = Object.assign({}, entry)

  if (encryptPayloadFn) {
    e.payload = e._payload
  }

  delete e._payload
  delete e.hash

  let { cid, bytes } = await Block.encode({ value: e, codec, hasher })

  if (encryptEntryFn) {
    bytes = await encryptEntryFn(bytes)
    const encryptedEntry = await Block.encode({ value: bytes, codec, hasher })
    cid = encryptedEntry.cid
    bytes = encryptedEntry.bytes
  }

  const hash = cid.toString(hashStringEncoding)

  return {
    hash,
    bytes
  }
}
Encodes an Entry and adds bytes field to it
@param {Entry} entry
@return {module:Log~Entry}
@memberof module:Log~Entry
@private