// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/ToStringUtils.java
// protected static final char ANSI_CODE_COLOR_END = 'm';
// 
// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/ToStringUtils.java
// public static final DecimalFormatSymbols DECIMALS_FORMAT_SYMBOLS =
//         DecimalFormatSymbols.getInstance(Locale.ROOT);
// 
// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/ToStringUtils.java
// protected static final char UNICODE_CTRL = '\u001b';
// 
// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/ToStringUtils.java
// public static String spaces(
//         int n) {
// 
//     return repeatString(" ", n);
// 
// }
// 
// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/ToStringUtils.java
// protected enum AnsiCodeColors {
// 
//     /**
//      * Red font color.
//      */
//     RED_FONT(31),
// 
//     /**
//      * Green font color.
//      */
//     GREEN_FONT(32),
// 
//     /**
//      * Blue font color.
//      */
//     BLUE_FONT(34),
// 
//     /**
//      * Reset color.
//      */
//     RESET(0);
// 
//     /**
//      * Color number.
//      */
//     private int number;
// 
//     /**
//      * Color code.
//      */
//     private String code;
// 
//     /**
//      * Constructor.
//      * 
//      * @param number Color number.
//      */
//     AnsiCodeColors(
//             int number) {
// 
//         this.number = number;
//         this.code = Character.toString(UNICODE_CTRL)
//                 + Character.toString(ANSI_CODE_START)
//                 + Integer.toString(number)
//                 + Character.toString(ANSI_CODE_COLOR_END);
// 
//     }
// 
//     /**
//      * @return The color number.
//      */
//     protected int getNumber() {
//         return number;
//     }
// 
//     /**
//      * @return The color code.
//      */
//     protected String getCode() {
//         return code;
//     }
// 
//     /**
//      * Removes all ANSI code colors from a string.
//      * 
//      * @param string A string.
//      * @return The string without any ANSI code colors.
//      */
//     protected static String remove(
//             String string) {
// 
//         return ANSI_CODE_COLOR_PATTERN.matcher(string).replaceAll("");
// 
//     }
// 
// }


import static com.github.s3curitybug.similarityuniformfuzzyhash.ToStringUtils.ANSI_CODE_COLOR_END;
import static com.github.s3curitybug.similarityuniformfuzzyhash.ToStringUtils.DECIMALS_FORMAT_SYMBOLS;
import static com.github.s3curitybug.similarityuniformfuzzyhash.ToStringUtils.UNICODE_CTRL;
import static com.github.s3curitybug.similarityuniformfuzzyhash.ToStringUtils.spaces;
import org.apache.commons.io.IOUtils;
import org.fusesource.jansi.AnsiConsole;
import com.github.s3curitybug.similarityuniformfuzzyhash.ToStringUtils.AnsiCodeColors;
import java.io.PrintStream;
import java.net.URL;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.text.DecimalFormat;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;

package com.github.s3curitybug.similarityuniformfuzzyhash;





/**
 * This class provides utility static methods to represent and compare Uniform Fuzzy Hashes in
 * visual way.
 * 
 * @author s3curitybug@gmail.com
 *
 */
public final class VisualRepresentation {

    /**
     * Charset in which bases are encoded.
     */
    public static final Charset BASES_ENCODING = StandardCharsets.UTF_8;

    /**
     * Printable ASCII base.
     */
    public static final char[] PRINTABLE_ASCII_BASE = readBaseFromResources("printableAscii.base");

    /**
     * Default base.
     */
    public static final char[] DEFAULT_BASE = PRINTABLE_ASCII_BASE;

    /**
     * Default factor divisor.
     */
    public static final int DEFAULT_FACTOR_DIVISOR = 3;

    /**
     * Default line wrap.
     */
    public static final int DEFAULT_LINE_WRAP = 60;

    /**
     * Bases path inside resources.
     */
    private static final String RESOURCES_BASES_PATH = "/VisualPrint/";

    /**
     * Format in which accumulated wrap length per line will be formatted during a string wrap.
     */
    private static final String ACCUMULATED_WRAP_FORMAT = "%5s  %s";

    /**
     * Format in which percent accumulated wrap length per line will be formatted during a string
     * wrap.
     */
    private static final DecimalFormat ACCUMULATED_WRAP_DECIMAL_FORMAT =
            new DecimalFormat("0.0", DECIMALS_FORMAT_SYMBOLS);

    /**
     * ANSI format which will be used to visually represent the blocks which are only present in the
     * first hash in a comparison.
     */
    private static final String BLOCK_IN_FIRST_HASH_ANSI_CODE_FORMAT =

// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/ToStringUtils.java
// protected static final char ANSI_CODE_COLOR_END = 'm';
// 
// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/ToStringUtils.java
// public static final DecimalFormatSymbols DECIMALS_FORMAT_SYMBOLS =
//         DecimalFormatSymbols.getInstance(Locale.ROOT);
// 
// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/ToStringUtils.java
// protected static final char UNICODE_CTRL = '\u001b';
// 
// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/ToStringUtils.java
// public static String spaces(
//         int n) {
// 
//     return repeatString(" ", n);
// 
// }
// 
// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/ToStringUtils.java
// protected enum AnsiCodeColors {
// 
//     /**
//      * Red font color.
//      */
//     RED_FONT(31),
// 
//     /**
//      * Green font color.
//      */
//     GREEN_FONT(32),
// 
//     /**
//      * Blue font color.
//      */
//     BLUE_FONT(34),
// 
//     /**
//      * Reset color.
//      */
//     RESET(0);
// 
//     /**
//      * Color number.
//      */
//     private int number;
// 
//     /**
//      * Color code.
//      */
//     private String code;
// 
//     /**
//      * Constructor.
//      * 
//      * @param number Color number.
//      */
//     AnsiCodeColors(
//             int number) {
// 
//         this.number = number;
//         this.code = Character.toString(UNICODE_CTRL)
//                 + Character.toString(ANSI_CODE_START)
//                 + Integer.toString(number)
//                 + Character.toString(ANSI_CODE_COLOR_END);
// 
//     }
// 
//     /**
//      * @return The color number.
//      */
//     protected int getNumber() {
//         return number;
//     }
// 
//     /**
//      * @return The color code.
//      */
//     protected String getCode() {
//         return code;
//     }
// 
//     /**
//      * Removes all ANSI code colors from a string.
//      * 
//      * @param string A string.
//      * @return The string without any ANSI code colors.
//      */
//     protected static String remove(
//             String string) {
// 
//         return ANSI_CODE_COLOR_PATTERN.matcher(string).replaceAll("");
// 
//     }
// 
// }


// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/VisualRepresentation.java
import static com.github.s3curitybug.similarityuniformfuzzyhash.ToStringUtils.ANSI_CODE_COLOR_END;
import static com.github.s3curitybug.similarityuniformfuzzyhash.ToStringUtils.DECIMALS_FORMAT_SYMBOLS;
import static com.github.s3curitybug.similarityuniformfuzzyhash.ToStringUtils.UNICODE_CTRL;
import static com.github.s3curitybug.similarityuniformfuzzyhash.ToStringUtils.spaces;
import org.apache.commons.io.IOUtils;
import org.fusesource.jansi.AnsiConsole;
import com.github.s3curitybug.similarityuniformfuzzyhash.ToStringUtils.AnsiCodeColors;
import java.io.PrintStream;
import java.net.URL;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.text.DecimalFormat;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;

package com.github.s3curitybug.similarityuniformfuzzyhash;





/**
 * This class provides utility static methods to represent and compare Uniform Fuzzy Hashes in
 * visual way.
 * 
 * @author s3curitybug@gmail.com
 *
 */
public final class VisualRepresentation {

    /**
     * Charset in which bases are encoded.
     */
    public static final Charset BASES_ENCODING = StandardCharsets.UTF_8;

    /**
     * Printable ASCII base.
     */
    public static final char[] PRINTABLE_ASCII_BASE = readBaseFromResources("printableAscii.base");

    /**
     * Default base.
     */
    public static final char[] DEFAULT_BASE = PRINTABLE_ASCII_BASE;

    /**
     * Default factor divisor.
     */
    public static final int DEFAULT_FACTOR_DIVISOR = 3;

    /**
     * Default line wrap.
     */
    public static final int DEFAULT_LINE_WRAP = 60;

    /**
     * Bases path inside resources.
     */
    private static final String RESOURCES_BASES_PATH = "/VisualPrint/";

    /**
     * Format in which accumulated wrap length per line will be formatted during a string wrap.
     */
    private static final String ACCUMULATED_WRAP_FORMAT = "%5s  %s";

    /**
     * Format in which percent accumulated wrap length per line will be formatted during a string
     * wrap.
     */
    private static final DecimalFormat ACCUMULATED_WRAP_DECIMAL_FORMAT =
            new DecimalFormat("0.0", DECIMALS_FORMAT_SYMBOLS);

    /**
     * ANSI format which will be used to visually represent the blocks which are only present in the
     * first hash in a comparison.
     */
    private static final String BLOCK_IN_FIRST_HASH_ANSI_CODE_FORMAT =

            AnsiCodeColors.GREEN_FONT.getCode();
