Converting hex string and byte array by Scala

Converting hex string to byte array, and byte array to hex string by Scala.

One thought on “Converting hex string and byte array by Scala

  1. How about:
    str.replaceAll(“[^0-9A-Fa-f]”, “”).grouped(2).toArray map { Integer.parseInt(_, 16).toByte }

    ?

Leave a Reply

Your email address will not be published. Required fields are marked *