I try the following code in c# and it give me the result as follow:
long dec1 = Convert.ToInt64("B62FD56EFD5B375D", 16);
result : -531879796222753398
I am trying to do this in java, but I always get NumberFormatException
, because there are alphanumeric inside the String. What I code in java is:
Long.parseLong("B62FD56EFD5B375D", 16);
May I know what is the equivalent of this in java?
Long.parseLong(text, 16)
to be fine.NumberFormatException
.long result = Long.parseUnsignedLong("B62FD56EFD5B375D", 16);
should give you the same result both in java and .net . btw the result you're showing in your post doesn't seem to be what I've getting on JetBrains Rider when i execute the code. I am getting-5318797962227533987
for both java and c#.