<commit_before>package edu.umd.cs.findbugs.cloud.appEngine.protobuf;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.google.protobuf.ByteString;

public final class AppEngineProtoUtil {
	private AppEngineProtoUtil() { }

	public static ByteString encodeHash(String hash) {
		return ByteString.copyFrom(new BigInteger(hash, 16).toByteArray());
	}

	public static String decodeHash(ByteString hash) {<commit_msg>add assertion checking that encoding/decoding is an identity<commit_after>package edu.umd.cs.findbugs.cloud.appEngine.protobuf;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.google.protobuf.ByteString;

public final class AppEngineProtoUtil {
	private AppEngineProtoUtil() { }

	public static ByteString encodeHash(String hash) {
		ByteString result = ByteString.copyFrom(new BigInteger(hash, 16).toByteArray());
		assert hash.equals(decodeHash(result));
		return result;
	}

	public static String decodeHash(ByteString hash) {
{'fraction_non_alphanumeric': 0.09659613615455381, 'fraction_numerical': 0.0036798528058877645, 'mean_word_length': 6.064935064935065, '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': '3442615', 'n_tokens_mistral': 332, 'n_tokens_neox': 316, 'n_words': 76}