public byte[] download(Dependency dependency) throws DependencyDownloadException {
        byte[] bytes = downloadRaw(dependency);

        // compute a hash for the downloaded file
        byte[] hash = Dependency.createDigest().digest(bytes);

        // ensure the hash matches the expected checksum
        if (!dependency.checksumMatches(hash)) {
            throw new DependencyDownloadException("Downloaded file had an invalid hash. " +
                    "Expected: " + Base64.getEncoder().encodeToString(dependency.getChecksum()) + " " +
                    "Actual: " + Base64.getEncoder().encodeToString(hash));
        }

        return bytes;
    }
Downloads the raw bytes of the {@code dependency}, and ensures the downloaded
bytes match the checksum.

@param dependency the dependency to download
@return the downloaded bytes
@throws DependencyDownloadException if unable to download
common/src/main/java/me/lucko/luckperms/common/dependencies/DependencyRepository.java