/* 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
("barak.haimovitch@haaretz.co.il",
20); String id
= padRight
("9037919764",
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();
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCQlTdHJpbmcgbmFtZSA9IHBhZFJpZ2h0KCJiYXJhay5oYWltb3ZpdGNoQGhhYXJldHouY28uaWwiLCAyMCk7CgkJCVN0cmluZyBpZCA9IHBhZFJpZ2h0KCI5MDM3OTE5NzY0IiwgMjApOwoJCQlTdHJpbmdCdWlsZGVyIG91dCA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CgkJCWZvciAoaW50IGkgPSAwOyBpIDwgMjA7IGkrKykgewoJCQkJb3V0LmFwcGVuZCgobmFtZS5jaGFyQXQoaSkgXiBpZC5jaGFyQXQ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