<commit_before>//
// Triple Play - utilities for use in PlayN-based games
// Copyright (c) 2011-2012, Three Rings Design, Inc. - All rights reserved.
// http://github.com/threerings/tripleplay/blob/master/LICENSE

package tripleplay.syncdb;

/**
 * Encodes and decodes ints and longs in base 90.
 */
public class Base90
{
    public static String encodeInt (int value) {
        StringBuffer buf = new StringBuffer();
        if (value < 0) {
            buf.append(NEG_MARKER);
            value -= Integer.MIN_VALUE;
        }
        while (value > 0) {
            buf.append(CHARS.charAt(value % BASE));
            value /= BASE;
        }
        return buf.toString();
    }

    public static int decodeInt (String data) {
        boolean neg = false;
        if (data.length() > 0 && data.charAt(0) == NEG_MARKER) {
            neg = true;
            data = data.substring(1);
        }
        int value = 0;
        for (int ii = data.length()-1; ii >= 0; ii--) {
            value *= BASE;
            value += data.charAt(ii) - FIRST;
        }
        if (neg) value += Integer.MIN_VALUE;
        return value;
    }

    public static String encodeLong (long value) {
        StringBuffer buf = new StringBuffer();
        if (value < 0) {<commit_msg>StringBuffer -> StringBuilder. Thanks Ray.<commit_after>//
// Triple Play - utilities for use in PlayN-based games
// Copyright (c) 2011-2012, Three Rings Design, Inc. - All rights reserved.
// http://github.com/threerings/tripleplay/blob/master/LICENSE

package tripleplay.syncdb;

/**
 * Encodes and decodes ints and longs in base 90.
 */
public class Base90
{
    public static String encodeInt (int value) {
        StringBuilder buf = new StringBuilder();
        if (value < 0) {
            buf.append(NEG_MARKER);
            value -= Integer.MIN_VALUE;
        }
        while (value > 0) {
            buf.append(CHARS.charAt(value % BASE));
            value /= BASE;
        }
        return buf.toString();
    }

    public static int decodeInt (String data) {
        boolean neg = false;
        if (data.length() > 0 && data.charAt(0) == NEG_MARKER) {
            neg = true;
            data = data.substring(1);
        }
        int value = 0;
        for (int ii = data.length()-1; ii >= 0; ii--) {
            value *= BASE;
            value += data.charAt(ii) - FIRST;
        }
        if (neg) value += Integer.MIN_VALUE;
        return value;
    }

    public static String encodeLong (long value) {
        StringBuilder buf = new StringBuilder();
        if (value < 0) {
{'fraction_non_alphanumeric': 0.12144803425457376, 'fraction_numerical': 0.01634877384196185, 'mean_word_length': 1.8492239467849223, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 10, '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': '6021310', 'n_tokens_mistral': 799, 'n_tokens_neox': 758, 'n_words': 225}