com.google.common.hash.HashCode.equalsSameBits()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(136)

本文整理了Java中com.google.common.hash.HashCode.equalsSameBits()方法的一些代码示例,展示了HashCode.equalsSameBits()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HashCode.equalsSameBits()方法的具体详情如下:
包路径:com.google.common.hash.HashCode
类名称:HashCode
方法名:equalsSameBits

HashCode.equalsSameBits介绍

[英]Returns whether this HashCode and that HashCode have the same value, given that they have the same number of bits.
[中]返回此哈希代码和该哈希代码是否具有相同的值,前提是它们具有相同的位数。

代码示例

代码示例来源:origin: google/guava

/**
 * Returns {@code true} if {@code object} is a {@link HashCode} instance with the identical byte
 * representation to this hash code.
 *
 * <p><b>Security note:</b> this method uses a constant-time (not short-circuiting) implementation
 * to protect against <a href="http://en.wikipedia.org/wiki/Timing_attack">timing attacks</a>.
 */
@Override
public final boolean equals(@Nullable Object object) {
 if (object instanceof HashCode) {
  HashCode that = (HashCode) object;
  return bits() == that.bits() && equalsSameBits(that);
 }
 return false;
}

代码示例来源:origin: google/j2objc

/**
 * Returns {@code true} if {@code object} is a {@link HashCode} instance with the identical byte
 * representation to this hash code.
 *
 * <p><b>Security note:</b> this method uses a constant-time (not short-circuiting) implementation
 * to protect against <a href="http://en.wikipedia.org/wiki/Timing_attack">timing attacks</a>.
 */
@Override
public final boolean equals(@NullableDecl Object object) {
 if (object instanceof HashCode) {
  HashCode that = (HashCode) object;
  return bits() == that.bits() && equalsSameBits(that);
 }
 return false;
}

代码示例来源:origin: wildfly/wildfly

/**
 * Returns {@code true} if {@code object} is a {@link HashCode} instance with the identical byte
 * representation to this hash code.
 *
 * <p><b>Security note:</b> this method uses a constant-time (not short-circuiting) implementation
 * to protect against <a href="http://en.wikipedia.org/wiki/Timing_attack">timing attacks</a>.
 */
@Override
public final boolean equals(@NullableDecl Object object) {
 if (object instanceof HashCode) {
  HashCode that = (HashCode) object;
  return bits() == that.bits() && equalsSameBits(that);
 }
 return false;
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

/**
 * Returns {@code true} if {@code object} is a {@link HashCode} instance with the identical byte
 * representation to this hash code.
 *
 * <p><b>Security note:</b> this method uses a constant-time (not short-circuiting) implementation
 * to protect against <a href="http://en.wikipedia.org/wiki/Timing_attack">timing attacks</a>.
 */
@Override
public final boolean equals(@NullableDecl Object object) {
 if (object instanceof HashCode) {
  HashCode that = (HashCode) object;
  return bits() == that.bits() && equalsSameBits(that);
 }
 return false;
}

代码示例来源:origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

/**
 * Returns {@code true} if {@code object} is a {@link HashCode} instance with the identical byte
 * representation to this hash code.
 *
 * <p><b>Security note:</b> this method uses a constant-time (not short-circuiting) implementation
 * to protect against <a href="http://en.wikipedia.org/wiki/Timing_attack">timing attacks</a>.
 */
@Override
public final boolean equals(@Nullable Object object) {
 if (object instanceof HashCode) {
  HashCode that = (HashCode) object;
  return bits() == that.bits() && equalsSameBits(that);
 }
 return false;
}

相关文章