public static BigInteger K(byte[] s, byte[] w) {
        BigInteger base = BigInteger.valueOf(s.length);
        
        BigInteger sum = BigInteger.ZERO;
        for (int i = 0; i < w.length; i++) {
            BigInteger value = BigInteger.valueOf(ConCh.indexOf(s, w[i]));
            sum = sum.add(value.multiply(base.pow(i)));
        }
        return sum;
    }