code: public static long hash(final BsonDocument doc) {
      if (doc == null) {
        return 0L;
      }
  
      final byte[] docBytes = toBytes(doc);
      long hashValue = FNV_64BIT_OFFSET_BASIS;
  
      for (int offset = 0; offset < docBytes.length; offset++) {
        hashValue ^= (0xFF & docBytes[offset]);
        hashValue *= FNV_64BIT_PRIME;
      }
  
      return hashValue;
    }
docs: Implementation of FNV-1a hash algorithm.
  @see <a href="https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function">
  ttps://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function</a>
  @param doc the document to hash
  @return