Java Utililty Methods Hash String

List of utility methods to do Hash String

Description

The list of methods to do Hash String are organized into topic(s).

Method

inthash(String str, int max)
hash
int hash = str.hashCode();
return hash % max;
longhash(String str, int offset)
Creates the hash of the specified string with the specified offset.
long seed1 = 0x7FED7FEDL;
long seed2 = 0xEEEEEEEEL;
for (char c : str.toCharArray()) {
    long ch = Character.toUpperCase(c);
    seed1 = stormBuffer[(int) (offset + ch)] ^ (seed1 + seed2);
    seed1 = seed1 & MASK_INT;
    long seed12 = (seed1 + seed2) & MASK_INT;
    long seed2Shifted = (seed2 << 5) & MASK_INT;
...
inthash(String string)
Hashes the specified string.
return string.hashCode();
Stringhash(String string, int length)
Estrae una stringa che rappresenta l'hash code di una stringa data
return lSet(right(string.hashCode() + "", length), length);
Stringhash(String strPlain)
Hash
return String.valueOf(strPlain.hashCode());
inthash32(String data)
hash
return data.hashCode();
inthashAlgToId(String hashAlg)
hash Alg To Id
int hashId = 0;
if (hashAlg.compareToIgnoreCase("SHA1") == 0) {
    hashId = ALG_SHA1;
} else if (hashAlg.compareToIgnoreCase("SHA224") == 0) {
    hashId = ALG_SHA224;
} else if (hashAlg.compareToIgnoreCase("SHA256") == 0) {
    hashId = ALG_SHA256;
} else if (hashAlg.compareToIgnoreCase("SHA384") == 0) {
...
StringhashArrayToString(int a[])
hash Array To String
StringBuffer sb = new StringBuffer();
for (int i = 0; i < a.length; i++)
    sb.append(i + 1).append(DELIMITER).append(a[i]).append(" ");
return sb.toString().trim();
Stringhashbang(final String historyToken)
Hashbang makes #!hash googleables https://developers.google.com/webmasters/ajax-crawling/docs/getting-started
return historyToken == null || historyToken.startsWith(PREFIX) ? historyToken : PREFIX + historyToken;
inthashcode(String name)
hashcode
return name.hashCode();