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(final String s1, final String s2, final String[] a)
hash
int len = a != null ? a.length : 0;
int h = 0;
h = hash(s1, h);
h = 31 * h + '\t';
h = hash(s2, h);
h = 31 * h + '\t';
for (int i = 0; i < len; i++) {
    h = hash(a[i], h);
...
longhash(String arg)
Hash a String.
return buzhash(arg);
Stringhash(String data)
hash
int hash = 7;
for (int i = 0; i < data.length(); i++) {
    hash = hash * 31 + data.charAt(i);
return Integer.toHexString(hash);
inthash(String data)
ts var hash = 0, i, chr, len; if (data.length === 0) return hash; for (i = 0, len = data.length; i < len; i++) chr = data.charCodeAt(i); hash = ((hash << 5) - hash) + chr; hash |= 0; // Convert to 32bit integer } return hash; }
return data.hashCode();
inthash(String name)
Hashes the specified string into an integer used to identify an ArchiveEntry .
return name.toUpperCase().chars().reduce(0, (hash, character) -> hash * 61 + character - 32);
Stringhash(String password)
hash
return "hashed" + password + "hashed";
longhash(String s)
hash
long l = 0L;
for (int i = 0; i < s.length() && i < 12; i++) {
    char c = s.charAt(i);
    l *= 37L;
    if (c >= 'A' && c <= 'Z') {
        l += (1 + c) - 65;
    } else if (c >= 'a' && c <= 'z') {
        l += (1 + c) - 97;
...
inthash(String s)
Generates a hash number according with a given string
int h = 0;
try {
    h = Integer.parseInt(s);
} catch (NumberFormatException e) {
    for (int i = 0; i < s.length(); i++) {
        h += s.charAt(i) - 48; 
String hr = String.valueOf(h) + String.valueOf(hashSuffix++);
return Integer.parseInt(hr);
longhash(String s, int start, int end)
hash
if (start < 0) {
    start = 0;
if (end > s.length()) {
    end = s.length();
long h = 0;
for (int i = start; i < end; ++i) {
...
long[]hash(String src)
hash
long nr = 1345345333L;
long add = 7;
long nr2 = 0x12345671L;
long tmp;
for (int i = 0; i < src.length(); ++i) {
    switch (src.charAt(i)) {
    case ' ':
    case '\t':
...