Converts the given value (0-255) into its hexadecimal representation
517779
def toFloat(val):
    """"""
    hex = "0123456789abcdef"
    return float(hex.find(val[0]) * 16 + hex.find(val[1]))
222230
def hex16_to_u64be(data):
    """"""
    return int(data[14:16] + data[12:14] + data[10:12] + data[8:10] + data[6:8] + data[4:6] + data[2:4] + data[0:2], 16)
1060815
function encode_numeric(str) {
    var len = str.length;
    var bits = [];

    for (var i = 0; i < len; i += 3) {
        var s = str.substr(i, 3);
        var b = Math.ceil(s.length * 10 / 3);
        pushBits(bits, b, parseInt(s, 10));
    }

    var res = {};

    var d = [0, 0, 0, 1];
    pushBits(d, 14, len);
    res.data27 = d.concat(bits);

    if (len < 4096) {
        var d = [0, 0, 0, 1];
        pushBits(d, 12, len);
        res.data10 = d.concat(bits);
    }

    if (len < 1024) {
        var d = [0, 0, 0, 1];
        pushBits(d, 10, len);
        res.data1 = d.concat(bits);
    }

    return res;
}
1336319
function(value) {
      var s = '';
      var i = 1;
      var len = value.length - 1;
      var c, c2, hex, n, index, length;

      while (i < len) {
        c = value.charAt(i++);

        if (c === '\\') {
          if (i < len) {
            c2 = value.charCodeAt(i);
            if (isLineTerminator(c2)) {
              i++;
              if (c2 === 0x0D && i < len && value.charCodeAt(i) === 0x0A) {
                i++;
              }
              continue;
            }
          }

          c = value.charAt(i++);
          switch (c) {
            case 'b':
              c = '\b';
              break;
            case 't':
              c = '\t';
              break;
            case 'r':
              c = '\r';
              break;
            case 'n':
              c = '\n';
              break;
            case 'v':
              c = '\x0B';
              break;
            case 'f':
              c = '\f';
              break;
            case 'u':
            case 'x':
              if (c === 'u' && i < len && value.charAt(i) === '{') {
                i++;
                index = value.indexOf('}', i);
                if (!~index) {
                  this.unexpected();
                }
                hex = value.substring(i, index);
                i = index + 1;
              } else {
                length = c === 'u' ? 4 : 2;
                hex = value.substr(i, length);
                i += length;
              }
              c = fromCodePoint(parseInt(hex, 16));
              break;
            default:
              if (isOctalDigit(c)) {
                n = c;
                do {
                  c = value.charAt(i);
                  if (!isOctalDigit(c)) {
                    break;
                  }
                  n += c;
                } while (i++ < len && n.length < 3);

                if (n.length > 0 && n.charAt(0) === '0') {
                  n = n.substring(1);
                }
                c = fromCharCode(parseInt(n, 8));
              }
          }
        }
        s += c;
      }

      return s;
    }
52452
function ab2hex(buffer) {
  const hexArr = Array.prototype.map.call(
    new Uint8Array(buffer),
    function (bit) {
      return ('00' + bit.toString(16)).slice(-2)
    }
  )
  return hexArr.join('')
}
936101
private static String convertISO88591toUTF8(String value) {
    try {
      return new String(value.getBytes(CharEncoding.ISO_8859_1), CharEncoding.UTF_8);
    }
    catch (UnsupportedEncodingException ex) {
      // ignore and fallback to original encoding
      return value;
    }
  }
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;
}
343170
def _hexvalue_to_hsv(hexvalue):
        
        h = int(hexvalue[7:10], 16) / 360
        s = int(hexvalue[10:12], 16) / 255
        v = int(hexvalue[12:14], 16) / 255

        return (h, s, v)
800938
protected static long fromHex(String hex) {
        long value = 0;
        for (int i = 0; i < hex.length(); i++)
            value = (value << 4) | digit(hex.charAt(i), 16);

        return value;
    }

    protected static String encodeULong(long value) {
        return String.format("%016x", value);
    }

    protected static String encodeUInt(int value) {
        return String.format("%08x", value);
    }

    protected static int normalizeFloat(float value) {
        int intBits = floatToIntBits(value);
        if (intBits < 0)
            return ~intBits;
        else
            return intBits ^ Integer.MIN_VALUE;
    }

    protected static float denormalizeFloat(int value) {
        if (value > 0)
            return intBitsToFloat(~value);
        else
            return intBitsToFloat(value ^ Integer.MIN_VALUE);
    }

    protected static long normalizeDouble(double value) {
        long longBits = doubleToRawLongBits(value);
        if (longBits < 0)
            return ~longBits;
        else
            return longBits ^ Long.MIN_VALUE;
    }

    protected static double denormalizeDouble(long value) {
        if (value > 0)
            return longBitsToDouble(~value);
        else
            return longBitsToDouble(value ^ Long.MIN_VALUE);
    }

    public static byte[] reverse(byte[] bytes) {
        byte[] result = new byte[bytes.length];

        for (int i = 0; i < bytes.length; i++)
            result[i] = (byte) (0xff - (0xff & bytes[i]));

        return result;
    }
}
476857
function( input ) {

    var len = input.length
    var chr, out = ''

    function hex( number ) {
      return number.toString( 16 ).toUpperCase()
    }

    for( var i = 0; i < len; i++ ) {
      chr = input.charCodeAt( i )
      if( chr >= 0x41 && chr <= 0x5A ) {
        out = out + input[i]
      } else if( chr >= 0x61 && chr <= 0x7A ) {
        out = out + input[i]
      } else if( chr >= 0x30 && chr <= 0x39 ) {
        out = out + input[i]
      } else if( input[i].match( /[-_.!~*'()]/ ) ) {
        out = out + input[i]
      } else if( chr <= 0x007F ) {
        out = out + '%' + hex( chr )
      } else if( chr <= 0x07FF ) {
        out = out + '%' + hex( 0xC0 | (chr >>   6) )
        out = out + '%' + hex( 0x80 | (chr & 0x3F) )
      } else {
        out = out + '%' + hex( 0xE0 | (chr >> 12) )
        out = out + '%' + hex( 0x80 | ((chr >> 6) & 0x3F) )
        out = out + '%' + hex( 0x80 | (chr & 0x3F) )
      }
    }

    return out

  }
880687
def from_hex(cls, value):
        """"""
        if len(value) == 8:
            return cls(int(value, 16))
        elif len(value) == 32:
            return cls(int(value, 16))
        else:
            raise ValueError('%r: invalid hexadecimal notation' % (value,))
911189
static String numericToTextFormat(byte[] src)
    {
        StringBuffer sb = new StringBuffer(39);
        for (int i = 0; i < (INADDRSZ / INT16SZ); i++) {
            sb.append(Integer.toHexString(((src[i<<1]<<8) & 0xff00)
                                          | (src[(i<<1)+1] & 0xff)));

            if (i < (INADDRSZ / INT16SZ) -1 ) {
               sb.append(":");
            }
        }
        return sb.toString();
    }
930254
function hexNumber(char) {
    var code = char.toLowerCase().charCodeAt(0);
    // 0-9
    if (code >= 48 && code <= 57) {
      return code - 48;
    }
    // a-f
    if (code >= 97 && code <= 102) {
      return code - 87;
    }
    return code;
  }
278633
private static short unsignedValueOf(byte value) {
        short result;
        if ((value & 0x80) != 0) {
            result = (short) (value & 0x7F);
            result |= 0x80;
        } else {
            result = value;
        }
        return result;
    }
1216132
def hex_from(val):
    
    if isinstance(val, integer_types):
        hex_str = '%x' % val
        if len(hex_str) % 2:
            hex_str = '0' + hex_str
        return hex_str

    return hexlify(val)
1024147
def _Encode(self, value):
    """"""
    try:
      return value.SerializeToString().encode("hex")
    except AttributeError:
      if isinstance(value, (int, long)):
        return str(value).encode("hex")
      else:
        # Types "string" and "bytes" are stored as strings here.
        return utils.SmartStr(value).encode("hex")
303743
def human(value):
    ""
    if value >= 1073741824000:
        return '{:.1f} T'.format(value / 1099511627776.0)
    if value >= 1048576000:
        return '{:.1f} G'.format(value / 1073741824.0)
    if value >= 1024000:
        return '{:.1f} M'.format(value / 1048576.0)
    if value >= 1000:
        return '{:.1f} K'.format(value / 1024.0)
    return '{}   B'.format(value)