Returns a sha1 of the given string
431199
def sha1(s):
    
    h = hashlib.new('sha1')
    h.update(s)
    return h.hexdigest()
23767
def _string_hash(s):
    """"""
    h = 5381
    for c in s:
        h = h * 33 + ord(c)
    return h
60100
public function sha1($format = null, $raw_output = false)
	{
		return hash('sha1', parent::format($format === null ? static::$format : $format), $raw_output);
	}
129068
def file_sha1(path):
  
  sha1 = hashlib.sha1()
  with open(path, "rb") as f:
    while True:
      block = f.read(2 ** 10)
      if not block:
        break
      sha1.update(block)
    return sha1.hexdigest()
883382
private static function __getHash($string)
	{
		return base64_encode(extension_loaded('hash') ?
		hash_hmac('sha1', $string, self::$__secretKey, true) : pack('H*', sha1(
		(str_pad(self::$__secretKey, 64, chr(0x00)) ^ (str_repeat(chr(0x5c), 64))) .
		pack('H*', sha1((str_pad(self::$__secretKey, 64, chr(0x00)) ^
		(str_repeat(chr(0x36), 64))) . $string)))));
	}
1220581
public static String sha1hmac(String key, String plaintext)
	{
		return sha1hmac(key, plaintext, ENCODE_HEX);
	}
675410
protected function _convert($string) {
		$symbols = $this->_symbols;

		$result = array_map(function($value) use ($symbols) {
			return $symbols[ord($value) & (count($symbols) - 1)];
		}, str_split(hash('sha1', $string)));

		return implode('', $result);
	}
1169392
private String getSignature(String str) {
    try {
      MessageDigest md = MessageDigest.getInstance(SHA_STRING);
      md.update(str.getBytes());
      md.update(secretBytes);
      byte[] digest = md.digest();
      return new Base64(0).encodeToString(digest);
    } catch (NoSuchAlgorithmException ex) {
      throw new RuntimeException("Invalid SHA digest String: " + SHA_STRING +
        " " + ex.getMessage(), ex);
    }
  }
435507
def hash_str(data, hasher=None):
    """"""
    hasher = hasher or hashlib.sha1()
    hasher.update(data)
    return hasher
572751
def sha1(str, lenght = 8)
      sha1 = Digest::SHA1.hexdigest(str)
      sha1[0, lenght.to_i]
    end
488932
function hash(str, algo, encoding) {
  return crypto
    .createHash(algo || 'sha1')
    .update(str)
    .digest(encoding || 'hex');
}
1262396
def content_sha1(context):
    
    try:
        content = context.current_parameters['content']
    except AttributeError:
        content = context
    return hashlib.sha1(encodeutils.to_utf8(content)).hexdigest()
298407
def hash(filepath, method='sha1', buffer_size=65536):
    
    if method == 'sha1':
        hash_function = hashlib.sha1()
    elif method == 'md5':
        hash_function = hashlib.md5()
    else:
        raise NotImplementedError('Only md5 and sha1 hashes are known, but '
                                  ' \'{}\' was specified.'.format(method))

    with open(filepath, 'rb') as fp:
        while True:
            data = fp.read(buffer_size)
            if not data:
                break
            hash_function.update(data)
    return hash_function.hexdigest()
985587
def sha1(filename):
    """"""
    filename = unmap_file(filename)
    if filename not in file_cache:
        cache_file(filename)
        if filename not in file_cache:
            return None
        pass
    if file_cache[filename].sha1:
        return file_cache[filename].sha1.hexdigest()
    sha1 = hashlib.sha1()
    for line in file_cache[filename].lines['plain']:
        sha1.update(line.encode('utf-8'))
        pass
    file_cache[filename].sha1 = sha1
    return sha1.hexdigest()
1138125
function hash (str) {
  return crypto
    .createHash('sha1')
    .update(str, 'ascii')
    .digest('base64')
    .replace(PLUS_GLOBAL_REGEXP, '-')
    .replace(SLASH_GLOBAL_REGEXP, '_')
    .replace(EQUAL_GLOBAL_REGEXP, '')
}
1360662
def get_SHA1_bin(word):
    
    from hashlib import sha1
    if PY3 and isinstance(word, str):
        word = word.encode('utf-8')

    hash_s = sha1()
    hash_s.update(word)
    return bin(int(hash_s.hexdigest(), 16))[2:].zfill(160)
956027
@SneakyThrows(IOException.class)
	public static String sha1(String input) throws NoSuchAlgorithmException {
		MessageDigest mDigest = MessageDigest.getInstance("SHA1");
		byte[] result = mDigest.digest(input.getBytes("UTF-8"));
		String resultString = String.format("%040x", new BigInteger(1, result));
		return resultString;
	}