// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/ToStringUtils.java
// public static final String BLOCKS_SEPARATOR = "-";
// 
// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/ToStringUtils.java
// protected static final int BLOCK_WITH_SEP_MAX_CHARS =
//         BLOCK_MAX_CHARS + BLOCKS_SEPARATOR.length();
// 
// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/ToStringUtils.java
// public static final String FACTOR_SEPARATOR = ":";
// 
// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/ToStringUtils.java
// protected static final int FACTOR_WITH_SEP_MAX_CHARS =
//         INT_MAX_CHARS + FACTOR_SEPARATOR.length();


import static com.github.s3curitybug.similarityuniformfuzzyhash.ToStringUtils.BLOCKS_SEPARATOR;
import static com.github.s3curitybug.similarityuniformfuzzyhash.ToStringUtils.BLOCK_WITH_SEP_MAX_CHARS;
import static com.github.s3curitybug.similarityuniformfuzzyhash.ToStringUtils.FACTOR_SEPARATOR;
import static com.github.s3curitybug.similarityuniformfuzzyhash.ToStringUtils.FACTOR_WITH_SEP_MAX_CHARS;
import org.apache.commons.io.IOUtils;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;

     * @param data Byte array of data.
     * @param factor Relation between data length and the hash mean number of blocks.
     *        Must be greater than 2 and must be odd.
     */
    public UniformFuzzyHash(
            byte[] data,
            int factor) {

        this();

        if (data == null) {
            throw new NullPointerException("Data is null.");
        }

        computeUniformFuzzyHash(data, factor);

    }

    /**
     * Builds a Uniform Fuzzy Hash from a string of data (using the platform's default charset) and
     * a factor.
     * 
     * @param data String of data.
     * @param factor Relation between data length and the hash mean number of blocks.
     *        Must be greater than 2 and must be odd.
     */
    public UniformFuzzyHash(
            String data,
            int factor) {


// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/ToStringUtils.java
// public static final String BLOCKS_SEPARATOR = "-";
// 
// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/ToStringUtils.java
// protected static final int BLOCK_WITH_SEP_MAX_CHARS =
//         BLOCK_MAX_CHARS + BLOCKS_SEPARATOR.length();
// 
// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/ToStringUtils.java
// public static final String FACTOR_SEPARATOR = ":";
// 
// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/ToStringUtils.java
// protected static final int FACTOR_WITH_SEP_MAX_CHARS =
//         INT_MAX_CHARS + FACTOR_SEPARATOR.length();


// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/UniformFuzzyHash.java
import static com.github.s3curitybug.similarityuniformfuzzyhash.ToStringUtils.BLOCKS_SEPARATOR;
import static com.github.s3curitybug.similarityuniformfuzzyhash.ToStringUtils.BLOCK_WITH_SEP_MAX_CHARS;
import static com.github.s3curitybug.similarityuniformfuzzyhash.ToStringUtils.FACTOR_SEPARATOR;
import static com.github.s3curitybug.similarityuniformfuzzyhash.ToStringUtils.FACTOR_WITH_SEP_MAX_CHARS;
import org.apache.commons.io.IOUtils;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;

     * @param data Byte array of data.
     * @param factor Relation between data length and the hash mean number of blocks.
     *        Must be greater than 2 and must be odd.
     */
    public UniformFuzzyHash(
            byte[] data,
            int factor) {

        this();

        if (data == null) {
            throw new NullPointerException("Data is null.");
        }

        computeUniformFuzzyHash(data, factor);

    }

    /**
     * Builds a Uniform Fuzzy Hash from a string of data (using the platform's default charset) and
     * a factor.
     * 
     * @param data String of data.
     * @param factor Relation between data length and the hash mean number of blocks.
     *        Must be greater than 2 and must be odd.
     */
    public UniformFuzzyHash(
            String data,
            int factor) {


        this();
