Reusable Java library of general tools with minimal external dependencies.
For questions or support, please contact us:
Email: support@aoindustries.com
Phone: 1-800-519-9541
Phone: +1-251-607-9556
Web: https://www.aoindustries.com/contact
public class HashedKey extends Object implements Comparable<HashedKey>
| Modifier and Type | Field and Description |
|---|---|
static String |
ALGORITHM |
static int |
HASH_BYTES
The number of bytes in the SHA-256 hash.
|
| Constructor and Description |
|---|
HashedKey(byte[] hash) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(HashedKey other) |
boolean |
equals(Object obj) |
static byte[] |
generateKey()
Generates a random plaintext key of
HASH_BYTES bytes in length. |
static byte[] |
hash(byte[] key)
SHA-256 hashes the given key.
|
int |
hashCode()
The hash code is just the first 32 bits of the hash.
|
String |
toString() |
public static final String ALGORITHM
public static final int HASH_BYTES
public HashedKey(byte[] hash)
hash - The provided parameter is zeroedpublic static byte[] generateKey()
HASH_BYTES bytes in length.#hashKey(byte[])public static byte[] hash(byte[] key)
generateKey()public int hashCode()
public int compareTo(HashedKey other)
compareTo in interface Comparable<HashedKey>Copyright © 2000–2016 AO Industries, Inc.. All rights reserved.