Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String combine(String h1,String h2) {
- int length = (h1.length() > h2.length()) ? h2.length() : h1.length();
- StringBuilder builder = new StringBuilder();
- for (int i =0 ; i<length; i+=2) {
- String output = h1.substring(i, (i + 2));
- String output2 = h2.substring(i, (i + 2));
- int decimal = Integer.parseInt(output, 16);
- int decimal2 = Integer.parseInt(output2, 16);
- int result = decimal ^ decimal2;
- builder.append(result + " ");
- }
- return builder.toString();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement