// Path: encoder/src/main/java/ru/bullyboo/encoder/utils/ArrayUtils.java
// public class ArrayUtils {
// 
//     public static int[] mergeArrays(byte[] mainArray, int[] appendArray){
// 
//         int[] array = new int[mainArray.length + appendArray.length];
// 
//         int mainSize = mainArray.length;
//         int appendSize = appendArray.length;
// 
//         for(int i = 0; i < mainSize; i++){
//             array[i] = mainArray[i];
//         }
// 
//         System.arraycopy(appendArray, 0, array, mainSize, appendSize);
// 
//         return array;
//     }
// 
//     public static int[] mergeArrays(int[] mainArray, int[] appendArray){
//         int[] array = new int[mainArray.length + appendArray.length];
// 
//         int mainSize = mainArray.length;
//         int appendSize = appendArray.length;
// 
//         System.arraycopy(mainArray, 0, array, 0, mainSize);
// 
//         System.arraycopy(appendArray, 0, array, mainSize, appendSize);
// 
//         return array;
//     }
// 
//     public static int[] convertListToArray(List<Integer> integerList){
//         int[] array = new int[integerList.size()];
// 
//         for(int i = 0; i < integerList.size(); i++){
//             array[i] = integerList.get(i);
//         }
// 
//         return array;
//     }
// }


import java.util.ArrayList;
import java.util.List;
import ru.bullyboo.encoder.utils.ArrayUtils;
     */
    private static final int[] X = {
            0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
            7,  4, 13,  1, 10,  6, 15,  3, 12,  0,  9,  5,  2, 14, 11,  8,
            3, 10, 14,  4,  9, 15,  8,  1,  2,  7,  0,  6, 13, 11,  5, 12,
            1,  9, 11, 10,  0,  8, 12,  4, 13,  3,  7, 15, 14,  5,  6,  2,
            4,  0,  5,  9,  7, 12,  2, 10, 14,  1,  3,  8, 11,  6, 15, 13,
    };

    /**
     * Index of 32-bits word in right line
     */
    private static final int[] XX = {
            5, 14,  7,  0,  9,  2, 11,  4, 13,  6, 15,  8,  1, 10,  3, 12,
            6, 11,  3,  7,  0, 13,  5, 10, 14, 15,  8, 12,  4,  9,  1,  2,
            15,  5,  1,  3,  7, 14,  6,  9, 11,  8, 12,  2, 10,  0,  4, 13,
            8,  6,  4,  1,  3, 11, 15,  0,  5, 12,  2, 13,  9,  7, 10, 14,
            12, 15, 10,  4,  1,  5,  8,  7,  6,  2, 13, 14,  0,  3,  9, 11
    };

    /**
     * This method return hash of message
     */
    public String getHash(String input){
        byte[] bytes = input.getBytes();

        List<Integer> intList = appendPaddingBits(bytes);

        intList = appendLength(intList, bytes.length * 8);

// Path: encoder/src/main/java/ru/bullyboo/encoder/utils/ArrayUtils.java
// public class ArrayUtils {
// 
//     public static int[] mergeArrays(byte[] mainArray, int[] appendArray){
// 
//         int[] array = new int[mainArray.length + appendArray.length];
// 
//         int mainSize = mainArray.length;
//         int appendSize = appendArray.length;
// 
//         for(int i = 0; i < mainSize; i++){
//             array[i] = mainArray[i];
//         }
// 
//         System.arraycopy(appendArray, 0, array, mainSize, appendSize);
// 
//         return array;
//     }
// 
//     public static int[] mergeArrays(int[] mainArray, int[] appendArray){
//         int[] array = new int[mainArray.length + appendArray.length];
// 
//         int mainSize = mainArray.length;
//         int appendSize = appendArray.length;
// 
//         System.arraycopy(mainArray, 0, array, 0, mainSize);
// 
//         System.arraycopy(appendArray, 0, array, mainSize, appendSize);
// 
//         return array;
//     }
// 
//     public static int[] convertListToArray(List<Integer> integerList){
//         int[] array = new int[integerList.size()];
// 
//         for(int i = 0; i < integerList.size(); i++){
//             array[i] = integerList.get(i);
//         }
// 
//         return array;
//     }
// }


// Path: encoder/src/main/java/ru/bullyboo/encoder/hashes/RIPEMD_320.java
import java.util.ArrayList;
import java.util.List;
import ru.bullyboo.encoder.utils.ArrayUtils;

     */
    private static final int[] X = {
            0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
            7,  4, 13,  1, 10,  6, 15,  3, 12,  0,  9,  5,  2, 14, 11,  8,
            3, 10, 14,  4,  9, 15,  8,  1,  2,  7,  0,  6, 13, 11,  5, 12,
            1,  9, 11, 10,  0,  8, 12,  4, 13,  3,  7, 15, 14,  5,  6,  2,
            4,  0,  5,  9,  7, 12,  2, 10, 14,  1,  3,  8, 11,  6, 15, 13,
    };

    /**
     * Index of 32-bits word in right line
     */
    private static final int[] XX = {
            5, 14,  7,  0,  9,  2, 11,  4, 13,  6, 15,  8,  1, 10,  3, 12,
            6, 11,  3,  7,  0, 13,  5, 10, 14, 15,  8, 12,  4,  9,  1,  2,
            15,  5,  1,  3,  7, 14,  6,  9, 11,  8, 12,  2, 10,  0,  4, 13,
            8,  6,  4,  1,  3, 11, 15,  0,  5, 12,  2, 13,  9,  7, 10, 14,
            12, 15, 10,  4,  1,  5,  8,  7,  6,  2, 13, 14,  0,  3,  9, 11
    };

    /**
     * This method return hash of message
     */
    public String getHash(String input){
        byte[] bytes = input.getBytes();

        List<Integer> intList = appendPaddingBits(bytes);

        intList = appendLength(intList, bytes.length * 8);

        int[] array = ArrayUtils.convertListToArray(intList);