// Path: library/src/main/java/com/pokegoapi/util/hash/Hash.java
// public class Hash {
// 	@Getter
// 	public final int locationAuthHash;
// 	@Getter
// 	public final int locationHash;
// 	@Getter
// 	public final List<Long> requestHashes;
// 
// 	/**
// 	 * Creates a hash object
// 	 *
// 	 * @param locationAuthHash the hash of the location and auth ticket
// 	 * @param locationHash the hash of the location
// 	 * @param requestHashes the hash of each request
// 	 */
// 	public Hash(int locationAuthHash, int locationHash, List<Long> requestHashes) {
// 		this.locationAuthHash = locationAuthHash;
// 		this.locationHash = locationHash;
// 		this.requestHashes = requestHashes;
// 	}
// }


import java.net.HttpURLConnection;
import java.net.URL;
import java.util.List;
import com.pokegoapi.exceptions.request.HashException;
import com.pokegoapi.exceptions.request.HashLimitExceededException;
import com.pokegoapi.exceptions.request.HashUnauthorizedException;
import com.pokegoapi.util.hash.Hash;
import com.pokegoapi.util.hash.HashProvider;
import com.squareup.moshi.Moshi;
import com.squareup.moshi.Moshi.Builder;
import lombok.Getter;
import lombok.Setter;
import net.iharder.Base64;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
			connection.setRequestProperty("content-type", "application/json");
			connection.setRequestProperty("User-Agent", "PokeGOAPI-Java");
			connection.setDoOutput(true);

			String requestJSON = MOSHI.adapter(Request.class).toJson(request);
			DataOutputStream out = new DataOutputStream(connection.getOutputStream());
			out.writeBytes(requestJSON);
			out.flush();
			out.close();

			int responseCode = connection.getResponseCode();

			this.key.setProperties(connection);

			String error = getError(connection);

			switch (responseCode) {
				case HttpURLConnection.HTTP_OK:
					BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
					StringBuilder builder = new StringBuilder();
					String line;
					while ((line = in.readLine()) != null) {
						builder.append(line);
					}
					in.close();
					Response response = MOSHI.adapter(Response.class).fromJson(builder.toString());
					long locationAuth = response.locationAuthHash;
					long location = response.locationHash;
					int locationAuthHash = (int) ((locationAuth & 0xFFFFFFFFL) ^ (locationAuth >>> 32));
					int locationHash = (int) ((location & 0xFFFFFFFFL) ^ (location >>> 32));
// Path: library/src/main/java/com/pokegoapi/util/hash/Hash.java
// public class Hash {
// 	@Getter
// 	public final int locationAuthHash;
// 	@Getter
// 	public final int locationHash;
// 	@Getter
// 	public final List<Long> requestHashes;
// 
// 	/**
// 	 * Creates a hash object
// 	 *
// 	 * @param locationAuthHash the hash of the location and auth ticket
// 	 * @param locationHash the hash of the location
// 	 * @param requestHashes the hash of each request
// 	 */
// 	public Hash(int locationAuthHash, int locationHash, List<Long> requestHashes) {
// 		this.locationAuthHash = locationAuthHash;
// 		this.locationHash = locationHash;
// 		this.requestHashes = requestHashes;
// 	}
// }


// Path: library/src/main/java/com/pokegoapi/util/hash/pokehash/PokeHashProvider.java
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.List;
import com.pokegoapi.exceptions.request.HashException;
import com.pokegoapi.exceptions.request.HashLimitExceededException;
import com.pokegoapi.exceptions.request.HashUnauthorizedException;
import com.pokegoapi.util.hash.Hash;
import com.pokegoapi.util.hash.HashProvider;
import com.squareup.moshi.Moshi;
import com.squareup.moshi.Moshi.Builder;
import lombok.Getter;
import lombok.Setter;
import net.iharder.Base64;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;

			connection.setRequestProperty("content-type", "application/json");
			connection.setRequestProperty("User-Agent", "PokeGOAPI-Java");
			connection.setDoOutput(true);

			String requestJSON = MOSHI.adapter(Request.class).toJson(request);
			DataOutputStream out = new DataOutputStream(connection.getOutputStream());
			out.writeBytes(requestJSON);
			out.flush();
			out.close();

			int responseCode = connection.getResponseCode();

			this.key.setProperties(connection);

			String error = getError(connection);

			switch (responseCode) {
				case HttpURLConnection.HTTP_OK:
					BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
					StringBuilder builder = new StringBuilder();
					String line;
					while ((line = in.readLine()) != null) {
						builder.append(line);
					}
					in.close();
					Response response = MOSHI.adapter(Response.class).fromJson(builder.toString());
					long locationAuth = response.locationAuthHash;
					long location = response.locationHash;
					int locationAuthHash = (int) ((locationAuth & 0xFFFFFFFFL) ^ (locationAuth >>> 32));
					int locationHash = (int) ((location & 0xFFFFFFFFL) ^ (location >>> 32));
					return new Hash(locationAuthHash, locationHash, response.requestHashes);