Execution hash is computed from JCas currentExperimentId, trace and sequenceId
@return MD5 hash corresponding to the above mentioned elements
505398
public static String getExecutionIdHash(String experimentId, Trace trace, String sequenceId) {
    HashFunction hf = Hashing.md5();
    Hasher hasher = hf.newHasher();
    hasher.putString(experimentId,StandardCharsets.UTF_8);
    hasher.putString(trace.getTrace(),StandardCharsets.UTF_8);
    hasher.putString(String.valueOf(sequenceId),StandardCharsets.UTF_8);
    HashCode hash = hasher.hash();
    final String traceHash = hash.toString();
    return traceHash;
  }
679545
static String md5(String input) {
    if (input == null || input.length() == 0) {
      throw new IllegalArgumentException("Input string must not be blank.");
    }
    try {
      MessageDigest algorithm = MessageDigest.getInstance("MD5");
      algorithm.reset();
      algorithm.update(input.getBytes());
      byte[] messageDigest = algorithm.digest();

      StringBuilder hexString = new StringBuilder();
      for (byte messageByte : messageDigest) {
        hexString.append(Integer.toHexString((messageByte & 0xFF) | 0x100).substring(1, 3));
      }
      return hexString.toString();
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
285443
public static byte[] hash(InputStream in) throws IOException {
        if (HASH_DIGEST == null) {
            throw new EvernoteUtilException(EDAM_HASH_ALGORITHM + " not supported", new NoSuchAlgorithmException(EDAM_HASH_ALGORITHM));
        }

        byte[] buf = new byte[1024];
        int n;
        while ((n = in.read(buf)) != -1) {
            HASH_DIGEST.update(buf, 0, n);
        }
        return HASH_DIGEST.digest();
    }
1029604
protected byte[] ensure128BitMD5(byte[] digest) {
        if(digest.length == MD5_LENGTH) {
            return digest;
        } else if(digest.length > MD5_LENGTH) {
            byte[] b = new byte[MD5_LENGTH];
            System.arraycopy(digest, 0, b, 0, MD5_LENGTH);
            return b;
        } else {
            byte[] b = new byte[MD5_LENGTH];
            System.arraycopy(digest, 0, b, 0, digest.length);
            Arrays.fill(b, digest.length, b.length, (byte)0);
            return b;
        }
    }
660230
public function getHashCode()
    {
        return md5(
            $this->conditionType .
            $this->operatorType .
            implode(';', $this->condition) .
            $this->style->getHashCode() .
            __CLASS__
        );
    }
990662
public String toTraceString()
  {
    if (_traceableString == null)
    {
      if (_password != null)
      {
        try
        {
          MessageDigest digester = MessageDigest.getInstance("SHA-256");
          digester.update(SALT);

          for(char c : _password)
          {
            digester.update( (byte)((c&0xFF00)>>8) );
            digester.update( (byte)((c&0x00FF))    );
          }

          byte[] hash = digester.digest();
          StringBuilder sb = new StringBuilder();

          // Throw away the high nibbles of each byte to increase security and reduce the
          // length of the trace string
          for (byte b:hash)
          {
            int i = b & 0x0F;
            sb.append(Integer.toHexString(i));
          }
          _traceableString = sb.toString();
        }
        catch(NoSuchAlgorithmException nsae)
        {
          // No FFDC Code needed - fall back on the toString implementation
          _traceableString = toString();
        }
      }
      else
      {
        _traceableString = ""; /* not just null :-) */
      }
    }

    return _traceableString;
  }
81028
private static long calculateKetamaHash(final byte[] key) {
        try {
            MessageDigest md5 = MessageDigest.getInstance("MD5");
            md5.update(key);
            byte[] digest = md5.digest();
            long rv = ((long) (digest[3] & 0xFF) << 24)
                    | ((long) (digest[2] & 0xFF) << 16)
                    | ((long) (digest[1] & 0xFF) << 8)
                    | (digest[0] & 0xFF);
            return rv & 0xffffffffL;
        } catch (NoSuchAlgorithmException e) {
            throw new IllegalStateException("Could not encode ketama hash.", e);
        }
    }
886465
public function getHashCode()
    {
        if ($this->isSupervisor) {
            return $this->getSharedComponent()->getHashCode();
        }
        return md5(
            $this->argb .
            __CLASS__
        );
    }
900891
private String makeMd5(final String original) {
		MessageDigest digest = null;
		try {
			digest = MessageDigest.getInstance("MD5");
			byte[] hash = digest.digest(original.getBytes("UTF-8"));
			StringBuilder builder = new StringBuilder();
			for (byte element : hash) {
				if ((0xff & element) < 0x10) {
					builder.append("0" + Integer.toHexString(0xff & element));
				} else {
					builder.append(Integer.toHexString(0xff & element));
				}
			}
			return builder.toString();
		} catch (Exception ex) {
			COVERAGE_LOG.error(ex.getMessage(), ex);
		}
		return "";
	}
276579
public static String md5Hex(final String input) {
		if (input == null) {
			throw new NullPointerException("String is null");
		}

    	MessageDigest digest = null;
    	
    	try {
    		digest = MessageDigest.getInstance("MD5");
    	} catch (NoSuchAlgorithmException e) {
    		// this should never happen
    		throw new RuntimeException(e);
    	}
        
        byte[] hash = digest.digest(input.getBytes());
        
        return DatatypeConverter.printHexBinary(hash);
    }
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();
    }
803481
public function getHashCode() {
    	return md5(
    		  $this->_conditionType
    		. $this->_operatorType
    		. implode(';', $this->_condition)
    		. $this->_style->getHashCode()
    		. __CLASS__
    	);
    }
759730
public String getMd5(String msg) {
		MessageDigest md;
		try {
			md = getMessageDigest();
			byte[] hash = md.digest(msg.getBytes(StandardCharsets.UTF_8));
			//converting byte array to Hexadecimal String
			StringBuilder sb = new StringBuilder(2 * hash.length);
			for (byte b : hash) {
				sb.append(String.format("%02x", b & 0xff));
			}
			return sb.toString();
		} catch (NoSuchAlgorithmException ex) {
			logger.error("Fail to get MD5 of String "+msg, ex);
		}
		return null;
	}
991173
public static String digestMD5(InputStream inputStream) {
        int size = 4096;
        int readLen = 32;
        StringBuilder md5String = new StringBuilder();
        try {
            byte[] buffer = new byte[size];
            MessageDigest md5 = MessageDigest.getInstance("MD5");
            int len;
            while ((len = inputStream.read(buffer, 0, size)) != -1) {
                md5.update(buffer, 0, len);
            }
            BigInteger bigInteger = new BigInteger(1, md5.digest());
            md5String.append(bigInteger.toString(16));
            if (md5String.length() < readLen) {
                int j = readLen - md5String.length();
                for (int i = 0; i < j; i++) {
                    md5String.insert(0, "0");
                }
            }
        } catch (NoSuchAlgorithmException | IOException e) {
            throw new IllegalArgumentException(e);
        }
        return md5String.toString();
    }
852211
def create_hash(sequence)
      Digest::MD5.hexdigest(sequence).to_s + "-" + Time.now.to_f.to_s
    end
732541
@Override
    public Serializable generateKey(final MethodInvocation methodInvocation) {
        //Determine the tareted CachableMethod
        final CachableMethod cachableMethod = this.resolveCacheableMethod(methodInvocation);

        //Use the resolved cachableMethod to determine the seed Map and then get the hash of the key elements
        final Object[] methodArguments = methodInvocation.getArguments();
        final Map<String, Object> seed = this.getSeed(methodArguments, cachableMethod);
        final Integer keyHashCode = this.getKeyHash(seed);

        //If no code generated return null
        if (keyHashCode == null) {
            if (this.logger.isDebugEnabled()) {
                this.logger.debug("No cache key generated for MethodInvocation='" + methodInvocation + "'");
            }
            return null;
        }

        //Calculate the hashCode and checkSum
        final HashCodeCalculator hashCodeCalculator = new HashCodeCalculator();
        hashCodeCalculator.append(keyHashCode);

        //Assemble the serializable key object
        final long checkSum = hashCodeCalculator.getCheckSum();
        final int hashCode = hashCodeCalculator.getHashCode();
        final HashCodeCacheKey hashCodeCacheKey = new HashCodeCacheKey(checkSum, hashCode);

        if (this.logger.isDebugEnabled()) {
            this.logger.debug("Generated cache key '" + hashCodeCacheKey + "' for MethodInvocation='" + methodInvocation + "'");
        }
        return hashCodeCacheKey;
    }
233684
private function generateHash()
    {
        $sHash = jaxon()->getVersion();
        foreach($this->xPluginManager->getRequestPlugins() as $xPlugin)
        {
            $sHash .= $xPlugin->generateHash();
        }
        foreach($this->xPluginManager->getResponsePlugins() as $xPlugin)
        {
            $sHash .= $xPlugin->generateHash();
        }
        return md5($sHash);
    }