Skip to content

Instantly share code, notes, and snippets.

@jieniu
Created January 25, 2019 03:27
Show Gist options
  • Save jieniu/d905d1943d73bff69d678a20c9e7d468 to your computer and use it in GitHub Desktop.
Save jieniu/d905d1943d73bff69d678a20c9e7d468 to your computer and use it in GitHub Desktop.
how to parse a unsigned long string
// "14714368837763236677" -> -3732375235946314939
long long_id = new BigInteger(str_id.trim()).longValue();
// -3732375235946314939 -> "cc33f07f74f48345"
String str_hex_id = Long.toHexString(long_id);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment