daily pastebin goal
36%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static byte[] hexStringToByteArray(String s) {
  2.     int len = s.length();
  3.     byte[] data = new byte[len / 2];
  4.     for (int i = 0; i < len; i += 2) {
  5.         data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)
  6.                              + Character.digit(s.charAt(i+1), 16));
  7.     }
  8.     return data;
  9. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top