@Test public void runTest() { assertEquals("JBCUYTCP", Base32.base32("HELLO", Mode.ENCODE)); assertEquals("HELLO", Base32.base32("JBCUYTCP", Mode.DECODE)); }
public static String base32(String input, Mode mode) { String output = ""; org.apache.commons.codec.binary.Base32 base32 = new org.apache.commons.codec.binary.Base32(); if (mode == Mode.ENCODE) { output = base32.encodeToString(input.getBytes()); } if (mode == Mode.DECODE) { output = new String(base32.decode(input)); } return output; }
Base32 { public static String base32(String input, Mode mode) { String output = ""; org.apache.commons.codec.binary.Base32 base32 = new org.apache.commons.codec.binary.Base32(); if (mode == Mode.ENCODE) { output = base32.encodeToString(input.getBytes()); } if (mode == Mode.DECODE) { output = new String(base32.decode(input)); } return output; } }
Base32 { public static String base32(String input, Mode mode) { String output = ""; org.apache.commons.codec.binary.Base32 base32 = new org.apache.commons.codec.binary.Base32(); if (mode == Mode.ENCODE) { output = base32.encodeToString(input.getBytes()); } if (mode == Mode.DECODE) { output = new String(base32.decode(input)); } return output; }  }
Base32 { public static String base32(String input, Mode mode) { String output = ""; org.apache.commons.codec.binary.Base32 base32 = new org.apache.commons.codec.binary.Base32(); if (mode == Mode.ENCODE) { output = base32.encodeToString(input.getBytes()); } if (mode == Mode.DECODE) { output = new String(base32.decode(input)); } return output; }  static void main(String[] args); static String base32(String input, Mode mode); }
Base32 { public static String base32(String input, Mode mode) { String output = ""; org.apache.commons.codec.binary.Base32 base32 = new org.apache.commons.codec.binary.Base32(); if (mode == Mode.ENCODE) { output = base32.encodeToString(input.getBytes()); } if (mode == Mode.DECODE) { output = new String(base32.decode(input)); } return output; }  static void main(String[] args); static String base32(String input, Mode mode);  }