Translates an array of numbers to a hex string
@param {Array} arr
@returns {string}
763665
function toHexString(arr) {
                var str = '';
                for (var i = 0; i < arr.length; i++) {
                    var obj = (arr[i] >>> 0).toString(16);
                    str += '00000000'.substr(obj.length) + obj;
                }
                return str;
            }
506129
function toHex(bignum) {
      var tmp0 = bignum[0] < 0 ? (bignum[0]>>>0) : bignum[0];
      var tmp1 = bignum[1] < 0 ? (bignum[1]>>>0) : bignum[1];
      return tmp0.toString(16) + tmp1.toString(16);
    }
55866
function rgb2hex(rgbarray) {
    var hex = '#'
    rgbarray.forEach( function (dig) {
      dig = dig.toString(16)
      hex += ("00" + dig).substr( dig.length )
    })
    return hex
  }
924249
function toHex(i) {
    var hex;

    if (i < 0) {
        i += 256;
    }
    hex = i.toString(16);

    // zero padding
    if (hex.length == 1) {
        hex = "0" + hex;
    }
    return hex;
}
155328
function convertData2Hexd (data) {
  if (!isHexString(data)) {
    var hex = ''
    for (var i = 0; i < data.length; i++) {
      hex += data.charCodeAt(i).toString(16)
    }
    return '0x' + hex
  }
  return data
}
1110757
function hex2a(hex) {
  return Array.from(hex)
    .map(s => {
      if (s >= "0" && s <= "9") {
        return String.fromCharCode(s.charCodeAt(0) + N_TO_A);
      } else if (s >= "a" && s <= "f") {
        return String.fromCharCode(s.charCodeAt(0) + A_TO_K);
      }
      throw new Error(`invalid char: ${s}`);
    })
    .join("");
}
888086
def _convert_1bit_array_to_byte_array(arr):
    
    # Padding if necessary
    while len(arr) < 8 or len(arr) % 8:
        arr.append(0)

    arr = _np.array(arr, dtype='uint8')
    bit_arr = []
    idx = 0
    # Iterate and combine 8-bits into a uint8
    for arr_idx in range(int(len(arr) / 8)):
        bit_arr.append(((arr[idx] << 7) & (1 << 7)) |
                        ((arr[idx+1] << 6) & (1 << 6)) |
                        ((arr[idx+2] << 5) & (1 << 5)) |
                        ((arr[idx+3] << 4) & (1 << 4)) |
                        ((arr[idx+4] << 3) & (1 << 3)) |
                        ((arr[idx+5] << 2) & (1 << 2)) |
                        ((arr[idx+6] << 1) & (1 << 1)) |
                        ((arr[idx+7] << 0) & (1 << 0))
                        )
        idx += 8
    return _np.array(bit_arr, dtype='uint8')
934206
function getHex(color) {
    var c = [ color[0], color[1], color[2] ].map(function(val) {
        return Math.floor(val * 255);
    });

    return "#" + ((c[2] | c[1] << 8 | c[0] << 16) | 1 << 24)
        .toString(16)
        .slice(1)
        .toUpperCase();
}
814332
function arrToString(arr) {
    if (arr.length === 0) return '';
    var str = '(' + Z.toString(arr[0]);
    for (var idx = 1; idx < arr.length; idx += 1) {
      str = str + ', ' + Z.toString(arr[idx]);
    }
    return str + ')';
  }
974374
function toHexString(number, numberOfBytes) {
  numberOfBytes = numberOfBytes || 1;
  let hexString = '00'.repeat(numberOfBytes) + number.toString(16);

  return hexString.substr(-2 * numberOfBytes);
}
557288
function(arr) {
    var key = 0;
    var max = arr[0];
    for(var i = 1, len = arr.length; i < len; i++) {
      if(arr[i] > max) {
        key = i;
        max = arr[i];
      }
    }
    return key;
  }
1020942
function convertArray(arr, pluralize, opts) {
  if (arr.length !== pluralize.count) throw new Error('missing required length of plural formats: expected ' + pluralize.count + '; got ' + arr.length);

  return pluralize.formats.reduce(function(acc, key, i) {
    acc[key] = arr[i];
    return acc;
  }, {});
}
1017556
function binToHex(binArray){
        var hexString = "0123456789abcdef",
            str = "",
            i;

        for(i = 0; i < binArray.length * 4; i++){
            str += hexString.charAt((binArray[i >> 2] >> ((3 - i % 4) * 8 + 4)) & 0xF) +
                    hexString.charAt((binArray[i >> 2] >> ((3 - i % 4) * 8  )) & 0xF);
        }

        return str;
    }
1126211
function convertUint8ArrayToString( array ) {

		var s = '';

		for ( var i = 0; i < array.length; i ++ ) {

			s += String.fromCharCode( array[ i ] );

		}

		return s;

	}
841565
function toBinaryString(arr) {
                var str = '';
                for (var i = 0; i < arr.length; i++) {
                    var obj = (arr[i] >>> 0).toString(2);
                    str += '00000000000000000000000000000000'.substr(obj.length) + obj;
                }
                return str;
            }
783745
function bytesToString(arr) {
    if (arr instanceof ArrayBuffer) {
        arr = new Uint8Array(arr);
    }
    return textDecoder.decode(arr);
}
563074
function hexStr2byteArray(str) {
  var byteArray = Array();
  var d = 0;
  var j = 0;
  var k = 0;

  for (let i = 0; i < str.length; i++) {
    var c = str.charAt(i);
    if (isHexChar(c)) {
      d <<= 4;
      d += hexChar2byte(c);
      j++;
      if (0 === (j % 2)) {
        byteArray[k++] = d;
        d = 0;
      }
    }
  }
  return byteArray;
}