/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
String name
= padRight
("balhadeff@bluewin.ch",
20); String id
= padRight
("144751207697",
20); StringBuilder out = new StringBuilder();
for (int i = 0; i < 20; i++) {
out.append((name.charAt(i) ^ id.charAt(i)) % 10);
}
byte[] rawDigest = out.toString().getBytes();
String digest
= md5sumToString
(rawDigest
); }
private static String padRight
(String up4Padding,
int requiredSize
) { return String.
format("%1$-" + requiredSize
+ "s", up4Padding
); }
public static String md5sumToString
(byte[] digest
) { StringBuilder result = new StringBuilder();
for (byte it : digest) {
result.
append(Integer.
toString((it
& 0xff
) + 0x100,
16).
substring(1)); }
return result.toString();
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCQlTdHJpbmcgbmFtZSA9IHBhZFJpZ2h0KCJiYWxoYWRlZmZAYmx1ZXdpbi5jaCIsIDIwKTsKCQkJU3RyaW5nIGlkID0gcGFkUmlnaHQoIjE0NDc1MTIwNzY5NyIsIDIwKTsKCQkJU3RyaW5nQnVpbGRlciBvdXQgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwoJCQlmb3IgKGludCBpID0gMDsgaSA8IDIwOyBpKyspIHsKCQkJCW91dC5hcHBlbmQoKG5hbWUuY2hhckF0KGkpIF4gaWQuY2hhckF0KGkpKSAlIDEwK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