org.helidb.lang.hasher
Class HasherSupport
java.lang.Object
org.helidb.lang.hasher.HasherSupport
public final class HasherSupport
- extends Object
This class contains static utility methods used by Hasher
implementations.
- Since:
- 1.0
- Author:
- Karl Gustafsson
- In_jar:
- helidb-core
Method Summary |
static byte |
getByteMask(int noOfBits)
Create a byte mask that will keep the noOfBits least significant
bits in a byte. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getByteMask
public static byte getByteMask(int noOfBits)
throws IllegalArgumentException
- Create a byte mask that will keep the
noOfBits
least significant
bits in a byte.
- Parameters:
noOfBits
- The number of bits to keep in a masked byte.
- Returns:
- A byte mask value that can be AND:ed with a byte.
- Throws:
IllegalArgumentException
- If noOfBits
is not between 0 and
8 (inclusive).