code: function toByteArray(hexString) {
    var out = [];
  
    for (var i = 0; i < hexString.length; i += 2) {
      out.push((parseInt(hexString.charAt(i), 16) << 4)
          + parseInt(hexString.charAt(i + 1), 16));
    }
  
    return out;
  }
docs: From [txeddystone_uid/MainActivity.java](https://goo.gl/VGtnN1)