<commit_before>package com.takwolf.crypto;

import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESedeKeySpec;
import javax.crypto.spec.IvParameterSpec;
import java.security.InvalidKeyException;
import java.security.Key;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import java.util.Arrays;

public final class DESedeUtils {

    private DESedeUtils() {}

    public Key generateKey(byte[] seed) throws CryptoException {
        try {
            SecretKeyFactory secretKeyFactory = SecretKeyFactory.getInstance("DESede");
            return secretKeyFactory.generateSecret(new DESedeKeySpec(seed));
        } catch (InvalidKeySpecException | NoSuchAlgorithmException | InvalidKeyException e) {
            throw new CryptoException(e);
        }
    }

    public IvParameterSpec generateIv(byte[] seed) {<commit_msg>工具类，方法声明为 static<commit_after>package com.takwolf.crypto;

import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESedeKeySpec;
import javax.crypto.spec.IvParameterSpec;
import java.security.InvalidKeyException;
import java.security.Key;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import java.util.Arrays;

public final class DESedeUtils {

    private DESedeUtils() {}

    public static Key generateKey(byte[] seed) throws CryptoException {
        try {
            SecretKeyFactory secretKeyFactory = SecretKeyFactory.getInstance("DESede");
            return secretKeyFactory.generateSecret(new DESedeKeySpec(seed));
        } catch (InvalidKeySpecException | NoSuchAlgorithmException | InvalidKeyException e) {
            throw new CryptoException(e);
        }
    }

    public static IvParameterSpec generateIv(byte[] seed) {
{'fraction_non_alphanumeric': 0.08253790005614824, 'fraction_numerical': 0.0, 'mean_word_length': 4.367469879518072, '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': '6983930', 'n_tokens_mistral': 482, 'n_tokens_neox': 472, 'n_words': 101}