37 lines
870 B
Java
37 lines
870 B
Java
/*
|
|
* To change this license header, choose License Headers in Project Properties.
|
|
* To change this template file, choose Tools | Templates
|
|
* and open the template in the editor.
|
|
*/
|
|
|
|
package puntocassa;
|
|
|
|
import org.bouncycastle.util.encoders.Base64;
|
|
|
|
/**
|
|
*
|
|
* @author Marco
|
|
*/
|
|
public class Encoding {
|
|
|
|
public static String encodeString(String var) {
|
|
String varEncode;
|
|
|
|
varEncode = new String(Base64.encode(new StringBuffer(new String(Base64.encode(var.getBytes()))).reverse().toString().getBytes()));
|
|
|
|
return varEncode;
|
|
}
|
|
|
|
public static String decodeString(String var) {
|
|
String varDecode;
|
|
|
|
varDecode = new String(Base64.decode(new StringBuffer(new String(Base64.decode(var.getBytes()))).reverse().toString().getBytes()));
|
|
|
|
return varDecode;
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
|
|
}
|
|
}
|