List of utility methods to do Hash String
String | hashCodeToString(long code) hash Code To String if (code < 0) { return "0" + (code * -1); } else { return "" + code; |
boolean | hasHeirarchy(String xpath) has Heirarchy return xpath.contains("/"); |
boolean | hasHexOrDecLongUrnSuffix(String value) has Hex Or Dec Long Urn Suffix String[] arr = value.split(":"); String suffix = arr[arr.length - 1]; return assertHexOrDecLongValue(suffix); |
boolean | hasHexPrefix(final String hexSymbols) has Hex Prefix return (hexSymbols.startsWith(HEX_STRING_PREFIX1) || hexSymbols.startsWith(HEX_STRING_PREFIX2));
|
boolean | hasHighChars(String s) has High Chars int len = s.length(); for (int i = 0; i < len; i++) { char ch = s.charAt(i); if (ch < LOWCHAR || ch > HIGHCHAR) { if (ch != '\n' && ch != '\r') return true; return false; |
boolean | hasHint(String hint, String parameter) has Hint return getHint(hint, parameter) != null;
|
int | hashIt(String s) hash It int hash = 0; int prime = 37; for (int i = 0; i < s.length(); i++) { hash += hash * prime + s.charAt(i); return hash; |
boolean | hasHost(String path) Is a host present in the url return path.startsWith("http://") || path.startsWith("https://"); |
String | hashOTP(String otp) hash OTP return Integer.toString(otp.hashCode());
|
short | hashPassword(String password) hash Password byte[] passwordCharacters = password.getBytes(); int hash = 0; if (passwordCharacters.length > 0) { int charIndex = passwordCharacters.length; while (charIndex-- > 0) { hash = ((hash >> 14) & 0x01) | ((hash << 1) & 0x7fff); hash ^= passwordCharacters[charIndex]; hash = ((hash >> 14) & 0x01) | ((hash << 1) & 0x7fff); hash ^= passwordCharacters.length; hash ^= (0x8000 | ('N' << 8) | 'K'); return (short) hash; |