<commit_before>package pl.stachuofficial.hirezapi.api;

import pl.stachuofficial.hirezapi.HiRezAPI;
import pl.stachuofficial.hirezapi.games.Paladins;
import pl.stachuofficial.hirezapi.games.Smite;

import java.security.MessageDigest;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.SimpleTimeZone;

public class Signature {
    private final String devId;
    private final String authKey;
    private final String platform;

    Signature(Smite.Platform platform, String devId, String authKey) {
        this.devId = devId;
        this.authKey = authKey;
        this.platform = "SMITE_" + platform.name();
    }

    Signature(Paladins.Platform platform, String devId, String authKey) {
        this.devId = devId;
        this.authKey = authKey;
        this.platform = "PALADINS_" + platform.name();
    }

    private String generateTimestamp() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
        sdf.setTimeZone(new SimpleTimeZone(SimpleTimeZone.UTC_TIME, "UTC"));
        return sdf.format(new Date());
    }

    private String generateSignature(String method) {
        try {
            String sig = devId + method + authKey + generateTimestamp();
            StringBuilder sb = new StringBuilder();


            MessageDigest md = MessageDigest.getInstance("MD5");
            md.update(sig.getBytes());
            byte bytes[] = md.digest();

            for (byte bit : bytes) {
                String hex = Integer.toHexString(0xff & bit);
                if (hex.length() == 1) sb.append("0");
                sb.append(hex);
            }
            return sb.toString();
        } catch (Exception ex) {
            ex.printStackTrace();
            return null;
        }
    }

    public String generateUrl(String method) {
        String url = method + "Json/";
        url += devId + "/";
        url += generateSignature(method) + "/";
        url += HiRezAPI.sessions.getProperty(platform);
        url += generateTimestamp() + "/";

        return url;
    }

    public String createSession() {
        String url = "createsessionJson/";
        url += devId + "/";
        url += generateSignature("createsession") + "/";
        url += generateTimestamp() + "/";

        return url;
    }
}<commit_msg>fixing 404 error endpoint<commit_after>package pl.stachuofficial.hirezapi.api;

import pl.stachuofficial.hirezapi.HiRezAPI;
import pl.stachuofficial.hirezapi.games.Paladins;
import pl.stachuofficial.hirezapi.games.Smite;

import java.security.MessageDigest;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.SimpleTimeZone;

public class Signature {
    private final String devId;
    private final String authKey;
    private final String platform;

    Signature(Smite.Platform platform, String devId, String authKey) {
        this.devId = devId;
        this.authKey = authKey;
        this.platform = "SMITE_" + platform.name();
    }

    Signature(Paladins.Platform platform, String devId, String authKey) {
        this.devId = devId;
        this.authKey = authKey;
        this.platform = "PALADINS_" + platform.name();
    }

    private String generateTimestamp() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
        sdf.setTimeZone(new SimpleTimeZone(SimpleTimeZone.UTC_TIME, "UTC"));
        return sdf.format(new Date());
    }

    private String generateSignature(String method) {
        try {
            String sig = devId + method + authKey + generateTimestamp();
            StringBuilder sb = new StringBuilder();


            MessageDigest md = MessageDigest.getInstance("MD5");
            md.update(sig.getBytes());
            byte bytes[] = md.digest();

            for (byte bit : bytes) {
                String hex = Integer.toHexString(0xff & bit);
                if (hex.length() == 1) sb.append("0");
                sb.append(hex);
            }
            return sb.toString();
        } catch (Exception ex) {
            ex.printStackTrace();
            return null;
        }
    }

    public String generateUrl(String method) {
        String url = method + "Json/";
        url += devId + "/";
        url += generateSignature(method) + "/";
        url += HiRezAPI.sessions.getProperty(platform) + "/";
        url += generateTimestamp();

        return url;
    }

    public String createSession() {
        String url = "createsessionJson/";
        url += devId + "/";
        url += generateSignature("createsession") + "/";
        url += generateTimestamp();

        return url;
    }
}
{'fraction_non_alphanumeric': 0.11551874455100261, 'fraction_numerical': 0.0023975588491717526, 'mean_word_length': 2.3374545454545457, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3869972', 'n_tokens_mistral': 1327, 'n_tokens_neox': 1270, 'n_words': 293}