<commit_before>package de.jeha.s3srv.common.security;

import org.apache.commons.lang3.RandomStringUtils;

/**
 * @author <EMAIL>
 */
public class Credentials {

    private final static String ACCESS_KEY_CHARS = "<KEY>";
    private final static int ACCESS_KEY_LENGTH = 20;

    private final static String SECRET_KEY_CHARS = "<KEY>";
    private final static int SECRET_KEY_LENGTH = 40;

    private final String accessKey;
    private final String secretKey;

    public Credentials(String accessKey, String secretKey) {
        this.accessKey = accessKey;
        this.secretKey = secretKey;
    }

    public String getAccessKey() {
        return accessKey;
    }

    public String getSecretKey() {
        return secretKey;
    }

    public static Credentials generateRandom() {
        String accessKey = RandomStringUtils.random(ACCESS_KEY_LENGTH, ACCESS_KEY_CHARS);
        String secretKey = RandomStringUtils.random(SECRET_KEY_LENGTH, SECRET_KEY_CHARS);

        return new Credentials(accessKey, secretKey);
    }

}<commit_msg>improve documentation<commit_after>package de.jeha.s3srv.common.security;

import org.apache.commons.lang3.RandomStringUtils;

/**
 * @author <EMAIL>
 */
public class Credentials {

    private final static String ACCESS_KEY_CHARS = "<KEY>";
    private final static int ACCESS_KEY_LENGTH = 20;

    private final static String SECRET_KEY_CHARS = "<KEY>";
    private final static int SECRET_KEY_LENGTH = 40;

    private final String accessKey;
    private final String secretKey;

    public Credentials(String accessKey, String secretKey) {
        this.accessKey = accessKey;
        this.secretKey = secretKey;
    }

    public String getAccessKey() {
        return accessKey;
    }

    public String getSecretKey() {
        return secretKey;
    }

    /**
     * Generates a random pair of access key and secret key in a pretty naive way.
     *
     * @return randomly generated credentials
     */
    public static Credentials generateRandom() {
        String accessKey = RandomStringUtils.random(ACCESS_KEY_LENGTH, ACCESS_KEY_CHARS);
        String secretKey = RandomStringUtils.random(SECRET_KEY_LENGTH, SECRET_KEY_CHARS);

        return new Credentials(accessKey, secretKey);
    }

}
{'fraction_non_alphanumeric': 0.07836153161175423, 'fraction_numerical': 0.005342831700801425, 'mean_word_length': 3.2963671128107075, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3833027', 'n_tokens_mistral': 670, 'n_tokens_neox': 633, 'n_words': 172}