Hashes `number` using the given `alphabet` sequence.
191321
def _hash(number, alphabet):
    """"""
    hashed = ''
    len_alphabet = len(alphabet)
    while True:
        hashed = alphabet[number % len_alphabet] + hashed
        number //= len_alphabet
        if not number:
            return hashed
339159
function hash(s) {
    var h = hash.BASE

    for (var i = 0, l = s.length; i < l; i++) {
        h ^= s.charCodeAt(i)
        h += (h << 1) + (h << 4) + (h << 7) + (h << 8) + (h << 24)
    }

    return h >>> 0
}
494617
function hashFromString(s) {
  return Math.abs(
    s.split("").reduce(function(prev, c) {
      var hash = (prev << 5) - prev + c.charCodeAt(0);
      return hash;
    }, 0)
  );
}
23302
def parse_number(self, s):
        """"""
        start = 1 if s[0] in ["-","+"] else 0

        all_digits = lambda x: all(map(lambda c: c.isdigit(), x))
        ishex = lambda c: c.isdigit() or ord(c.lower()) in range(ord("a"), ord("f"))
        all_hex = lambda x: all(map(ishex, x))

        if all_digits(s[start:]):
            try:
                return (Tokenizer.INTEGER, int(s))
            except ValueError:
                raise ParseError("%d:%d: Invalid integer '%s'" % (self.lineno,
                    self.column, s))

        if s[start:].startswith("0x") and all_hex(s[start+2:]):
            try:
                return (Tokenizer.INTEGER, int(s, base=16))
            except ValueError:
                raise ParseError("%d:%d: Invalid hexadecimal integer '%s'" %
                        (self.lineno, self.column, s))

        if any(map(lambda c: c==".", s)) or any(map(lambda c: c=="e", s)):
            try:
                return (Tokenizer.FLOAT, float(s))
            except ValueError:
                raise ParseError("%d:%d: Invalid float '%s'" % (self.lineno,
                    self.column, s))

        raise ParseError("%d:%d: Invalid number '%s'" % (self.lineno,
            self.column, s))
430528
def calculate_hash(options):
        """"""
        options = sorted(list(options))
        sha_hash = sha1()
        # equivalent to loop over the options and call sha_hash.update()
        sha_hash.update(''.join(options).encode('utf-8'))
        return sha_hash.hexdigest()
966326
def generate_key(s, pattern="%s.txt"):
    
    h = hashlib.sha1()
    #h.update(s)
    h.update(s.encode('utf-8'))
    return pattern % h.hexdigest()
527872
function hashSymbol( value ) {
	var i , iMax , hash = 0 , output , offset ;

	value = '' + value ;

	// At least 3 passes
	offset = 3 * 16 / value.length ;

	for ( i = 0 , iMax = value.length ; i < iMax ; i ++ ) {
		hash ^= value.charCodeAt( i ) << ( ( i * offset ) % 16 ) ;
		//hash += value.charCodeAt( i ) ;
		//hash += value.charCodeAt( i ) * ( i + 1 ) ;
	}

	output = symbols[ hash % symbols.length ] ;
	hash = Math.floor( hash / symbols.length ) ;

	output = string.ansi[ fgColors[ hash % fgColors.length ] ] + output ;
	hash = Math.floor( hash / fgColors.length ) ;

	output = string.ansi[ bgColors[ hash % bgColors.length ] ] + output ;
	hash = Math.floor( hash / bgColors.length ) ;

	output += string.ansi.reset ;

	return output ;
}
54451
function(input) {
  input = input.toString();
  var hash = 0, i, chr, len = input.length;
  if (len === 0) {
    return hash;
  }
  for (i = 0; i < len; i++) {
    chr = input.charCodeAt(i);
    hash = (hash << 5) - hash + chr;
    hash |= 0;
  }
  return hash;
}
1352616
function re_hash(s) {
    var sArray = s.split(""),
    	scode = [13, -1, 4, -2, 0, -2, 25];
    for(var j = 0 ; j<scode.length; j++) 
      if (scode[j] > 0) sArray = swap(sArray, scode[j]);
      else if (scode[j] === 0) sArray = sArray.reverse();
      else sArray = sArray.slice(-scode[j]);
    return sArray.join("");
}
1048016
public static int hash(String str, int k) {
		switch (k) {
			case 0:
				return HashUtil.rsHash(str);
			case 1:
				return HashUtil.jsHash(str);
			case 2:
				return HashUtil.elfHash(str);
			case 3:
				return HashUtil.bkdrHash(str);
			case 4:
				return HashUtil.apHash(str);
			case 5:
				return HashUtil.djbHash(str);
			case 6:
				return HashUtil.sdbmHash(str);
			case 7:
				return HashUtil.pjwHash(str);
			default:
				return 0;
		}
	}
1185210
def alphanum_key(string):
    
    convert = lambda text: int(text) if text.isdigit() else text
    return [convert(segment) for segment in re.split('([0-9]+)', string)]
902543
def compute_hash(func, string):
    """"""
    h = func()
    h.update(string)
    return h.hexdigest()
926220
def key(
        seq: Sequence,
        tooth: Callable[[Sequence], str] = (
            lambda seq: str(random.SystemRandom().choice(seq)).strip()
        ),
        nteeth: int = 6,
        delimiter: str = ' ',
) -> str:
    """"""
    return delimiter.join(tooth(seq) for _ in range(nteeth))
734377
function hex2num(hex) {
        if (hex.charAt(0) == "#") {
            hex = hex.slice(1);
        } //Remove the '#' char - if there is one.
        hex = hex.toUpperCase();
        var hex_alphabets = "0123456789ABCDEF";
        var value = new Array(3);
        var k = 0;
        var int1, int2;
        for (var i = 0; i < 6; i += 2) {
            int1 = hex_alphabets.indexOf(hex.charAt(i));
            int2 = hex_alphabets.indexOf(hex.charAt(i + 1));
            value[k] = int1 * 16 + int2;
            k++;
        }
        return value;
    }
268972
function hash() {
  var h = 0;
  for (var i = 0; i < arguments.length; i++) {
    var k = arguments[i];
    h += k;
    h += k << 10;
    h ^= k >> 6;
  }
  h += h << 3;
  h ^= h >> 11;
  h += h << 15;
  return h >= 0 ? h : -h;
}
771213
function _numberToKey(index, totalChar, offset) {
    var aArr = [],
      currentChar = index;
    totalChar = totalChar || 26;
    offset = offset || 65;
    while (currentChar >= totalChar) {
      aArr.push((currentChar % totalChar) + offset);
      currentChar = Math.floor(currentChar / totalChar - 1);
    }
    aArr.push(currentChar + offset);
    return aArr.reverse();
  }
729527
protected function hash($input, $alphabet): string
    {
        $hash = '';
        $alphabetLength = \mb_strlen($alphabet);

        do {
            $hash = \mb_substr($alphabet, $this->math->intval($this->math->mod($input, $alphabetLength)), 1).$hash;

            $input = $this->math->divide($input, $alphabetLength);
        } while ($this->math->greaterThan($input, 0));

        return $hash;
    }