@Deprecated
public class CachingUtility
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CHARACTER_ENCODING
Deprecated.
The character encoding that will be used when caching content bytes
|
static java.lang.String |
HASHING_ALGORITHM
Deprecated.
The hashing algorithm.
|
static int |
NUMBER_CONVERSION_RADIX
Deprecated.
The radix used for converting numbers to an output string value
|
Modifier and Type | Method and Description |
---|---|
static CompressionType |
getCompression(java.lang.String data)
Deprecated.
Returns the compression type that should be used to store the given string in the database
|
static java.math.BigInteger |
hash(byte[] inputBytes,
java.lang.String hashAlgorithm)
Deprecated.
Returns a hashed number for the input bytes, using a specified hash algorithm.
|
static java.lang.String |
hashAsString(byte[] inputBytes)
Deprecated.
Returns a hashed string of the input bytes
|
static java.lang.String |
hashAsString(byte[] inputBytes,
java.lang.String hashAlgorithm)
Deprecated.
Returns a hashed string of the input bytes using a specified hash algorithm.
|
static java.lang.String |
hashString(java.lang.String content)
Deprecated.
Hashes the string
|
static byte[] |
stringToBytes(java.lang.String data,
CompressionType compressionType)
Deprecated.
Converts a string to the bytes that should be written to the database
|
static java.io.InputStream |
stringToStream(java.lang.String data,
CompressionType compressionType)
Deprecated.
Converts the string to an input stream
|
public static final java.lang.String CHARACTER_ENCODING
public static final java.lang.String HASHING_ALGORITHM
public static final int NUMBER_CONVERSION_RADIX
public static java.lang.String hashString(@NotNull java.lang.String content)
content
- A string to hash, not nullpublic static java.lang.String hashAsString(@NotNull byte[] inputBytes)
inputBytes
- The input bytes to hash@Nullable public static java.io.InputStream stringToStream(@NotNull java.lang.String data, @NotNull CompressionType compressionType)
data
- The data to convertcompressionType
- The compression to use when converting the string to a stream@Nullable public static byte[] stringToBytes(@NotNull java.lang.String data, @NotNull CompressionType compressionType)
data
- The data to preparecompressionType
- The compression to use when converting the string to bytes@NotNull public static CompressionType getCompression(@NotNull java.lang.String data)
data
- The data that will be stored in the databaseCompressionType
that should be used to store the datapublic static java.lang.String hashAsString(@NotNull byte[] inputBytes, java.lang.String hashAlgorithm) throws java.security.NoSuchAlgorithmException
inputBytes
- The input bytes to hashhashAlgorithm
- The algorithm to use for hashingjava.security.NoSuchAlgorithmException
- If the algorithm specified doesn't existpublic static java.math.BigInteger hash(@NotNull byte[] inputBytes, java.lang.String hashAlgorithm) throws java.security.NoSuchAlgorithmException
inputBytes
- The input bytes to hashhashAlgorithm
- The algorithm to use for hashingjava.security.NoSuchAlgorithmException
- If the algorithm specified doesn't exist