Obtains the {@code HashCode} for the contents of {@code value}.

@param value a {@code CheckRequest} to be signed
@return the {@code HashCode} corresponding to {@code value}
354849
public static HashCode sign(CheckRequest value) {
    Hasher h = Hashing.md5().newHasher();
    Operation o = value.getOperation();
    if (o == null || Strings.isNullOrEmpty(o.getConsumerId())
        || Strings.isNullOrEmpty(o.getOperationName())) {
      throw new IllegalArgumentException("CheckRequest should have a valid operation");
    }
    h.putString(o.getConsumerId(), StandardCharsets.UTF_8);
    h.putChar('\0');
    h.putString(o.getOperationName(), StandardCharsets.UTF_8);
    h.putChar('\0');
    Signing.putLabels(h, o.getLabels());
    for (MetricValueSet mvSet : o.getMetricValueSetsList()) {
      h.putString(mvSet.getMetricName(), StandardCharsets.UTF_8);
      h.putChar('\0');
      for (MetricValue metricValue : mvSet.getMetricValuesList()) {
        MetricValues.putMetricValue(h, metricValue);
      }
    }
    return h.hash();
  }
857823
public static AcceptStatus fromValue(int value) {
        AcceptStatus status = VALUES.get(value);
        if (status == null) {
            status = new AcceptStatus(value);
            VALUES.put(value, status);
        }
        return status;
    }
642552
public static String script(String value) {
        return value != null ? StringEscapeUtils.escapeEcmaScript(value) : value;
    }
308949
private static byte[] getHash(byte[] value) {

        byte[] hash = new byte[value.length - Generate.SALT_BYTES];
        System.arraycopy(value, Generate.SALT_BYTES, hash, 0, hash.length);
        return hash;
    }
149552
public static HashCode sign(MetricValue value) {
    Hasher h = Hashing.md5().newHasher();
    return putMetricValue(h, value).hash();
  }
1268837
public static Digest valueOf(final String value) {
        final String[] parts = value.split("=", 2);
        if (parts.length == 2) {
            return new Digest(parts[0], parts[1]);
        }
        return null;
    }
1255396
@Override
	public int hash(T value) {
		int i = 0;
		try {
			int code = this.comparators[0].hash(value.getField(keyPositions[0]));
			
			for (i = 1; i < this.keyPositions.length; i++) {
				code *= HASH_SALT[i & 0x1F]; // salt code with (i % HASH_SALT.length)-th salt component
				code += this.comparators[i].hash(value.getField(keyPositions[i]));
			}
			return code;
		}
		catch (NullPointerException npex) {
			throw new NullKeyFieldException(keyPositions[i]);
		}
		catch (IndexOutOfBoundsException iobex) {
			throw new KeyFieldOutOfBoundsException(keyPositions[i]);
		}
	}
612492
boolean matches(String value) {
    if (pattern == null) {
      return true;
    }
    return pattern.matcher(value).matches();
  }
1079969
public ChainWriter encodeSh(Object value) throws IOException {
		Coercion.write(value, textInShEncoder, out);
		return this;
	}
1360617
public Integer convertToInt(String value) {
        Integer result = null;
        if (value != null) {
            result = Integer.valueOf(value);
        }
        return result;
    }
583460
public static CharSequence toParameterValue(final Boolean value) {
        return value != null ? Boolean.toString(value) : Attr.nullValue();
    }
1175416
public ChainWriter encodeXhtml(Object value) throws IOException {
		if(value!=null) {
			if(
				value instanceof Writable
				&& !((Writable)value).isFastToString()
			) {
				// Avoid unnecessary toString calls
				Coercion.write(value, textInXhtmlEncoder, out);
			} else {
				String str = Coercion.toString(value);
				BundleLookupMarkup lookupMarkup;
				BundleLookupThreadContext threadContext = BundleLookupThreadContext.getThreadContext(false);
				if(threadContext!=null) {
					lookupMarkup = threadContext.getLookupMarkup(str);
				} else {
					lookupMarkup = null;
				}
				if(lookupMarkup!=null) lookupMarkup.appendPrefixTo(MarkupType.XHTML, out);
				textInXhtmlEncoder.write(str, out);
				if(lookupMarkup!=null) lookupMarkup.appendSuffixTo(MarkupType.XHTML, out);
			}
		}
		return this;
	}
1279781
public static ReplyStatus fromValue(int value) {
        ReplyStatus status = VALUES.get(value);
        if (status == null) {
            status = new ReplyStatus(value);
            VALUES.put(value, status);
        }
        return status;
    }
944402
public static String byte2Hex(int value) {
    if (value > 255 || value < 0) {
      throw new IllegalArgumentException("The int converting to hex should be in range 0~255");
    }
    return String.valueOf(FIRST_CHAR[value]) + String.valueOf(SECOND_CHAR[value]);
  }
894767
public static RejectStatus fromValue(int value) {
        RejectStatus status = VALUES.get(value);
        if (status == null) {
            status = new RejectStatus(value);
            VALUES.put(value, status);
        }
        return status;
    }
1183610
public void checkPassword(String value) {

        if (!value.equals(password)) {
            throw Error.error(ErrorCode.X_28000);
        }
    }
253261
public static String base64Encode(final String value) {
        validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
        return Base64.getEncoder().encodeToString(value.getBytes(StandardCharsets.UTF_8));
    }