this js code
function keygen( serial) {
return parseInt(serial.replace(/-/g, ''), 16)
}
keygen("C6AD-0E40")
gives
3333230144
and this java code
private int keygens(String serial) {
String s=serial.replaceAll("[-]", "");
int dec=Integer.parseUnsignedInt(s,16);
return dec+dec+dec; //one dec give negative value wondering why !!
}
System.out.print(keygens("C6AD-0E40"));
gives
1409755840
WHY ? , i need to get the same return value of js function
Appreciate any help