Just can’t find a way to transform an Hex String to a number (Int, Long, Short) in Scala.
Is there something like "A".toInt(base)?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use the Java libs:
Or if you are feeling sparky :-):
Also, if you aren’t specifically trying to parse a String parameter into hex, note that Scala directly supports hexadecimal Integer literals. In this case:
Isn’t Scala wonderful? 🙂