\" \\ \/ \b \f \n \r \t \u1234 four-hex-digits
420056
@ThreadSafe public void stringEncode(String s, Writer writer) throws IOException {
		char[] carr = s.toCharArray();
		int len = carr.length;
		for(int i = 0; i < len; i++) {
			char c = carr[i];
			switch (c) {
			case '"':
				writer.write("\\\"");
				break;
			case '/':
				writer.write(escapeSlash ? "\\/" : "/");
				break;
			case '\\':
				writer.write("\\\\");
				break;
			case '\b':
				writer.write("\\b");
				break;
			case '\f':
				writer.write("\\f");
				break;
			case '\n':
				writer.write("\\n");
				break;
			case '\r':
				writer.write("\\r");
				break;
			case '\t':
				writer.write("\\t");
				break;
			default:
				if(unicodeEscapeAll) {
					if(c < 127) {
						writer.append(c);
					} else {
						String hex = Integer.toHexString(c);
						writer.write("\\u");
						switch (hex.length()) {
						case 1:
							writer.write("000");
							break;
						case 2:
							writer.write("00");
							break;
						case 3:
							writer.write("0");
							break;
						default:
							break;
						}
						writer.write(Integer.toHexString(c));
					}
				} else {
					writer.append(c);
				}
				break;
			}
		}
	}
587514
private static byte convertHexDigit( final byte b )
    {
        if ( ( b >= '0' ) && ( b <= '9' ) )
        {
            return (byte) ( b - '0' );
        }
        if ( ( b >= 'a' ) && ( b <= 'f' ) )
        {
            return (byte) ( b - 'a' + 10 );
        }
        if ( ( b >= 'A' ) && ( b <= 'F' ) )
        {
            return (byte) ( b - 'A' + 10 );
        }
        return 0;
    }
231436
function encodeLengthHex(n) {
    if (n<=127) return toHex(n)
    else {
        var n_hex = toHex(n)
        var length_of_length_byte = 128 + n_hex.length/2 // 0x80+numbytes
        return toHex(length_of_length_byte)+n_hex
    }
}
285221
def baseN(num, b, numerals="0123456789abcdefghijklmnopqrstuvwxyz"):
    
    return ((num == 0) and numerals[0]) or \
        (baseN(num // b, b, numerals).lstrip(numerals[0]) + numerals[num % b])
229313
function encode(number) {
        if (number === 0) {
            return '';
        }

        var quotient = Math.floor(number / 64);
        var remainder = number % 64;

        var digit;
        if (remainder < 10) {
            digit = '' + remainder;
        }
        else if (remainder < 36) {
            digit = String.fromCharCode(remainder + 55);
        }
        else if (remainder < 62) {
            digit = String.fromCharCode(remainder + 61);
        }
        else if (remainder === 62) {
            digit = '-';
        }
        else if (remainder === 63) {
            digit = '_';
        }

        return encode(quotient) + '' + digit;
    }
232607
def toHex(val):
    """"""
    hex = "0123456789abcdef"
    return hex[int(val / 16)] + hex[int(val - int(val / 16) * 16)]
1194623
function encode4(n) {
  assert(0 <= n && n <= 0xffffff, ENCODE_OUTOFBOUNDS + n)
  // 24 bits -> 4 digits
  const lower = isolate(n, 0, 6)
  const aboveLower = isolate(n, 6, 6)
  const belowUpper = isolate(n, 12, 6)
  const upper = isolate(n, 18, 6)
  return encode(upper) + encode(belowUpper)
    + encode(aboveLower) + encode(lower)
}
1184749
private static int toHex(int ch)
  {
    if (ch >= '0' && ch <= '9')
      return ch - '0';
    else if (ch >= 'a' && ch <= 'f')
      return ch - 'a' + 10;
    else if (ch >= 'A' && ch <= 'F')
      return ch - 'A' + 10;
    else
      return -1;
  }
1298201
function uuid() {
  return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>
    (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
  )
}
306652
function rgbToHex(r, g, b) {
    [r, g, b] = [limit(r, 0, 255), limit(g, 0, 255), limit(b, 0, 255)];
    return "#" + ("000000" + ((r << 16) | (g << 8) | b).toString(16)).slice(-6);
}
1237800
function bnpFromRadix(s, b)
{
  this.fromInt(0);
  if (b == null) b = 10;
  var cs = this.chunkSize(b);
  var d = Math.pow(b, cs),
    mi = false,
    j = 0,
    w = 0;
  for (var i = 0; i < s.length; ++i)
  {
    var x = intAt(s, i);
    if (x < 0)
    {
      if (s.charAt(i) == "-" && this.signum() == 0) mi = true;
      continue;
    }
    w = b * w + x;
    if (++j >= cs)
    {
      this.dMultiply(d);
      this.dAddOffset(w, 0);
      j = 0;
      w = 0;
    }
  }
  if (j > 0)
  {
    this.dMultiply(Math.pow(b, j));
    this.dAddOffset(w, 0);
  }
  if (mi) Int128.ZERO.subTo(this, this);
}
582859
function b64nltohex(s) {
    var b64 = s.replace(/[^0-9A-Za-z\/+=]*/g, '');
    var hex = b64tohex(b64);
    return hex;
}
425523
function(dec, bytes) {
    var hex = "",
        i;
    for (i = 0; i < bytes; i++) {
        hex += String.fromCharCode(dec & 0xff);
        dec = dec >>> 8;
    }
    return hex;
}
223643
function encodeHexToBase32_(hexString) {
  const initialPadding = 'ffffffffff';
  const finalPadding = '000000';
  const paddedHexString = initialPadding + hexString + finalPadding;
  const encodedString = encode32_(paddedHexString);

  const bitsPerHexChar = 4;
  const bitsPerBase32Char = 5;
  const numInitialPaddingChars =
      initialPadding.length * bitsPerHexChar / bitsPerBase32Char;
  const numHexStringChars =
      Math.ceil(hexString.length * bitsPerHexChar / bitsPerBase32Char);

  const result = encodedString.substr(numInitialPaddingChars, numHexStringChars);
  return result;
}
176755
function uint32BEtoNumber(bytes) {
  let n = 0;
  for (let i = 0; i < 3; i++) {
    n |= bytes[i];
    n <<= 8;
  }
  n |= bytes[3];
  return n;
}
589520
private void checkHexDigit(int c) throws IOException {
        if (c >= '0' && c <= '9') {
            return;
        }
        if (c >= 'a' && c <= 'f') {
            return;
        }
        if (c >= 'A' && c <= 'F') {
            return;
        }
        // Causes the invalid escape to be skipped
        hasNextChar = true;
        nextChar = c;
        throw new IOException("Did not find four digit hex character code."
                + " line: " + lexer.getLine() + " col:" + lexer.getColumn());
    }
718018
def ucharenc(a, i, u)
    if u <= Uchar1max
      a[i] = (u & 0xff).chr
      1
    elsif u <= Uchar2max
      a[i+0] = (Utag2 | ((u>>6)&0xff)).chr
      a[i+1] = (Utagx | (u&Umaskx)).chr
      2
    elsif u <= Uchar3max
      a[i+0] = (Utag3 | ((u>>12)&0xff)).chr
      a[i+1] = (Utagx | ((u>>6)&Umaskx)).chr
      a[i+2] = (Utagx | (u&Umaskx)).chr
      3
    else
      a[i+0] = (Utag4 | ((u>>18)&0xff)).chr
      a[i+1] = (Utagx | ((u>>12)&Umaskx)).chr
      a[i+2] = (Utagx | ((u>>6)&Umaskx)).chr
      a[i+3] = (Utagx | (u&Umaskx)).chr
      4
    end
  end