Returns the SHA-1 Hash of the Avatar image.

@return the SHA-1 Hash of the Avatar image.
511395
public String getAvatarHash() {
        byte[] bytes = getAvatar();
        if (bytes == null) {
            return null;
        }

        MessageDigest digest;
        try {
            digest = MessageDigest.getInstance("SHA-1");
        }
        catch (NoSuchAlgorithmException e) {
            LOGGER.log(Level.SEVERE, "Failed to get message digest", e);
            return null;
        }

        digest.update(bytes);
        return StringUtils.encodeHex(digest.digest());
    }
338036
public function get_sha1() {

        if ($this->plugin && $this->editor) {
            $plugin = $this->get_submission_plugin();
            $options = portfolio_format_text_options();
            $options->context = context_module::instance($this->cmid);

            $text = format_text($plugin->get_editor_text($this->editor, $this->sid),
                                $plugin->get_editor_format($this->editor, $this->sid),
                                $options);
            $textsha1 = sha1($text);
            $filesha1 = '';
            try {
                $filesha1 = $this->get_sha1_file();
            } catch (portfolio_caller_exception $e) {
                // No files.
            }
            return sha1($textsha1 . $filesha1);
        }
        return $this->get_sha1_file();
    }
90223
public static String SHA1(String plainText) throws NoSuchAlgorithmException {
        // 返回值
        String result = null;
        // 是否是有效字符串
        if (StringUtils.isNotEmpty(plainText)) {
            // SHA 加密开始
            // 创建加密对象 并传入加密类型
            MessageDigest messageDigest = MessageDigest.getInstance(EncryptionType.SHA1);
            // 传入要加密的字符串
            messageDigest.update(plainText.getBytes());
            // 得到 byte 类型结果
            byte byteBuffer[] = messageDigest.digest();
            // 将 byte 转换为 string
            StringBuilder strHexString = new StringBuilder();
            // 遍历 byte buffer
            for (int i = 0; i < byteBuffer.length; i++) {
                String hex = Integer.toHexString(0xff & byteBuffer[i]);
                if (hex.length() == 1) {
                    strHexString.append('0');
                }
                strHexString.append(hex);
            }
            // 得到返回结果
            result = strHexString.toString();
        }
        return result;
    }
458363
public Sha256Hash getTxId() {
        if (cachedTxId == null) {
            if (!hasWitnesses() && cachedWTxId != null) {
                cachedTxId = cachedWTxId;
            } else {
                ByteArrayOutputStream stream = new UnsafeByteArrayOutputStream(length < 32 ? 32 : length + 32);
                try {
                    bitcoinSerializeToStream(stream, false);
                } catch (IOException e) {
                    throw new RuntimeException(e); // cannot happen
                }
                cachedTxId = Sha256Hash.wrapReversed(Sha256Hash.hashTwice(stream.toByteArray()));
            }
        }
        return cachedTxId;
    }
458869
public static String getSHA1Hash(final String input) throws HibiscusException  {

        String hashValue = null;

        try {

            final MessageDigest messageDigest = MessageDigest.getInstance(MESSAGE_DIGEST_ALGORITHM_SHA1);
            byte[] sha1Hash = new byte[BYTE_LENGTH_SHA1];

            messageDigest.update(input.getBytes(ENCODING_CHARSET_NAME), MESSAGE_DIGEST_UPDATE_OFFSET, input.length());
            sha1Hash = messageDigest.digest();

            hashValue = convertToHex(sha1Hash);

        } catch (NoSuchAlgorithmException e) {
            throw new HibiscusException("Unsupported Message Digest Algorithm "  + MESSAGE_DIGEST_ALGORITHM_SHA1, e);
        } catch (UnsupportedEncodingException e) {
            throw new HibiscusException("Unsupported Encoding " + ENCODING_CHARSET_NAME , e);
        }

        return hashValue;
    }
581886
public function getHashCode()
    {
        return md5(
            ($this->visible ? 't' : 'f') .
            $this->blurRadius .
            $this->distance .
            $this->direction .
            $this->alignment .
            $this->color->getHashCode() .
            $this->alpha .
            __CLASS__
        );
    }
929104
public int hash() {
		hash ^= 4 * count;
		hash ^= hash >>> 16;
		hash *= 0x85ebca6b;
		hash ^= hash >>> 13;
		hash *= 0xc2b2ae35;
		hash ^= hash >>> 16;

		return hash;
	}
829991
def get_avatar_url(self, size=2):
        
        hashbytes = self.get_ps('avatar_hash')

        if hashbytes != "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000":
            ahash = hexlify(hashbytes).decode('ascii')
        else:
            ahash = 'fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb'

        sizes = {
            0: '',
            1: '_medium',
            2: '_full',
        }
        url = "http://cdn.akamai.steamstatic.com/steamcommunity/public/images/avatars/%s/%s%s.jpg"

        return url % (ahash[:2], ahash, sizes[size])
17712
public function get_sha1() {
        if ($this->multifiles) {
            return sha1(serialize($this->entry) . $this->get_sha1_file());
        }
        return sha1(serialize($this->entry));
    }
126656
public static byte[] computeHash(String passwd) throws NoSuchAlgorithmException  {
        java.security.MessageDigest md = java.security.MessageDigest.getInstance("SHA-1");
        md.reset();
        md.update(passwd.getBytes());
        return md.digest();
    }
527220
def sha_hash(self) -> str:
        
        return hashlib.sha256(self.signed_raw().encode("ascii")).hexdigest().upper()
142697
public function getHash()
	{
		if (is_null($this->hash)) {
			if ($this->content != null) {
				$this->hash = sha1($this->content);
			} else {
				$path = ResourceUtil::createTempDir() . DIRECTORY_SEPARATOR . $this->getFilename();
				file_put_contents($path, $this->getStream());
				$this->hash = sha1_file($path);
				unlink($path);
				rmdir(dirname($path));
			}
		}
		return $this->hash;
	}
1117613
public static String shaBase64(String s) {
    try {
      MessageDigest messageDigest = MessageDigest.getInstance("SHA-1");
      byte[] sha1Bytes = messageDigest.digest(s.getBytes("UTF-8"));
      return ByteString.of(sha1Bytes).base64();
    } catch (NoSuchAlgorithmException e) {
      throw new AssertionError(e);
    } catch (UnsupportedEncodingException e) {
      throw new AssertionError(e);
    }
  }
463426
public function get_sha1() {
        // in the case that we're exporting a subclass of 'file' and we have a singlefile,
        // then we're not exporting any metadata, just the file by itself by mimetype.
        if ($this->exporter->get('format') instanceof portfolio_format_file && $this->singlefile) {
            return $this->get_sha1_file();
        }
        // otherwise we're exporting some sort of multipart content so use the data
        $str = '';
        foreach ($this->records as $record) {
            foreach ($record as $data) {
                if (is_array($data) || is_object($data)) {
                    $keys = array_keys($data);
                    $testkey = array_pop($keys);
                    if (is_array($data[$testkey]) || is_object($data[$testkey])) {
                        foreach ($data as $d) {
                            $str .= implode(',', (array)$d);
                        }
                    } else {
                        $str .= implode(',', (array)$data);
                    }
                } else {
                    $str .= $data;
                }
            }
        }
        return sha1($str . ',' . $this->exporter->get('formatclass'));
    }
1367601
public String getGravatar() {
        if (getEmail() == null) {
            return "http://www.gravatar.com/avatar/00000000000000000000000000000000";
        } else {
            final MD5 md5 = new MD5();
            final String hash = md5.calcMD5(getEmail());
            return "http://www.gravatar.com/avatar/" + hash;
        }
    }
1140948
public function getHash ()
    {
        if ($this->contextHashData['version'] !== $this->version) {
            $this->contextHashData['version'] = $this->version;
            $this->contextHashData['hash'] = md5(json_encode($this->data));
        }
        
        return $this->contextHashData['hash'];
    }
72897
private static String sha1hash(Collection<String> nquads) {
        try {
            // create SHA-1 digest
            final MessageDigest md = MessageDigest.getInstance("SHA-1");
            for (final String nquad : nquads) {
                md.update(nquad.getBytes("UTF-8"));
            }
            return encodeHex(md.digest());
        } catch (final NoSuchAlgorithmException e) {
            throw new RuntimeException(e);
        } catch (final UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        }
    }