code: function bytesToHex(arr) {
      if (arr instanceof ArrayBuffer) {
          arr = new Uint8Array(arr);
      }
      var str = '';
      for (var i = 0; i < arr.length; i++) {
          var byte = arr[i].toString(16);
          if (byte.length === 1) {
              str += '0';
          }
          str += byte;
      }
      return str;
  }
docs: Convert hex-string to byte array
  @param {Array|Uint8Array|ArrayBuffer} arr
  @return {string}