// 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;

            hash.factor = Integer.parseInt(factorString);
        } catch (NumberFormatException numberFormatException) {
            throw new IllegalArgumentException(String.format(
                    "Factor (%s) is not parseable.",
                    factorString.isEmpty()));
        }

        checkFactor(hash.factor);

        // Blocks.
        String blocksString = hashString.substring(splitIndex + 1);

        hash.blocks = new LinkedList<>();

        int blockNumber = 0;
        int blockStartingBytePosition = 0;

        if (!blocksString.isEmpty()) {

            splitIndex = 0;
            int lastSplitIndex = 0;
            while (splitIndex >= 0) {

                splitIndex = blocksString.indexOf(BLOCKS_SEPARATOR, lastSplitIndex);
                String blockString = null;
                if (splitIndex >= 0) {
                    blockString = blocksString.substring(lastSplitIndex, splitIndex);
                } else {
                    blockString = blocksString.substring(lastSplitIndex);
                }

// 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;

            hash.factor = Integer.parseInt(factorString);
        } catch (NumberFormatException numberFormatException) {
            throw new IllegalArgumentException(String.format(
                    "Factor (%s) is not parseable.",
                    factorString.isEmpty()));
        }

        checkFactor(hash.factor);

        // Blocks.
        String blocksString = hashString.substring(splitIndex + 1);

        hash.blocks = new LinkedList<>();

        int blockNumber = 0;
        int blockStartingBytePosition = 0;

        if (!blocksString.isEmpty()) {

            splitIndex = 0;
            int lastSplitIndex = 0;
            while (splitIndex >= 0) {

                splitIndex = blocksString.indexOf(BLOCKS_SEPARATOR, lastSplitIndex);
                String blockString = null;
                if (splitIndex >= 0) {
                    blockString = blocksString.substring(lastSplitIndex, splitIndex);
                } else {
                    blockString = blocksString.substring(lastSplitIndex);
                }

                lastSplitIndex = splitIndex + BLOCKS_SEPARATOR.length();
