Java String Encrypt encryptChar(String caracter, int variable, int indice)

Here you can find the source of encryptChar(String caracter, int variable, int indice)

Description

Encriptar caracter.

License

Open Source License

Parameter

Parameter Description
caracter the caracter
variable the variable
indice the indice

Return

the string

Declaration

private static String encryptChar(String caracter, int variable, int indice) 

Method Source Code

//package com.java2s;

public class Main {
    /** The patron busqueda. */
    private static String searchPattern = "9f0AwB7J8CpDud5E6FQGlxnHMbcI3K4LeUNzO1ms2PtRvSVkWXqirTYaghZjoy";
    /** The patron encripta. */
    private static String encryptPattern = "wxBU7nIGj9Flm8f0AH1bcK3hdi4WJ5ZLCpDeMvTQuVkXqraYE6gosyNzOP2RSt";

    /**//from  w  w  w.ja  v  a 2 s .c o  m
     * Encriptar caracter.
     * 
     * @param caracter
     *            the caracter
     * @param variable
     *            the variable
     * @param indice
     *            the indice
     * @return the string
     */
    private static String encryptChar(String caracter, int variable, int indice) {
        int ind;
        if (searchPattern.indexOf(caracter) != -1) {
            ind = (searchPattern.indexOf(caracter) + variable + indice) % searchPattern.length();
            return encryptPattern.substring(ind, ind + 1);
        }
        return caracter;
    }
}

Related

  1. encrypt(String string)
  2. encrypt0(final byte[] result)
  3. encryptBankCardNo(String cardNo)
  4. encryptBankCardNoLast4Bits(String cardNo)
  5. encryptBytes(final byte[] b, final int i)
  6. EncryptDecrypt(String value)
  7. encryptEmailId(String emailId)
  8. encryptIfNotEncrypted(String s)
  9. encryption(String str, int k)