Class DigestBuilder
- java.lang.Object
- 
- com.inductiveautomation.ignition.common.util.DigestBuilder
 
- 
 public class DigestBuilder extends java.lang.Object
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]build()Compute and return the digest.java.lang.StringbuildHexString()Compute and return the digest as a lower-case hex-encoded String.static DigestBuildercustom(java.lang.String algorithm)static DigestBuildermd5()DigestBuilderreset()Manually reset the underlyingMessageDigest.static DigestBuildersha1()static DigestBuildersha256()DigestBuilderupdate(boolean input)Update the digest input withinput.DigestBuilderupdate(byte input)Update the digest input withinput.DigestBuilderupdate(byte[] input)Update the digest input with the bytes from the big-endian representation of each element ofinput.DigestBuilderupdate(double input)Update the digest input with the bytes from the big-endian representation ofinput's raw long bits.DigestBuilderupdate(double[] input)Update the digest input with the bytes from the big-endian representation of each element ofinput.DigestBuilderupdate(float input)Update the digest input with the bytes from the big-endian representation ofinput's raw int bits.DigestBuilderupdate(float[] input)Update the digest input with the bytes from the big-endian representation of each element ofinput.DigestBuilderupdate(int input)Update the digest input with the bytes from the big-endian representation ofinput.DigestBuilderupdate(int[] input)Update the digest input with the bytes from the big-endian representation of each element ofinput.DigestBuilderupdate(long input)Update the digest input with the bytes from the big-endian representation ofinput.DigestBuilderupdate(long[] input)Update the digest input with the bytes from the big-endian representation of each element ofinput.DigestBuilderupdate(short input)Update the digest input with the bytes from the big-endian representation ofinput.DigestBuilderupdate(short[] input)Update the digest input with the bytes from the big-endian representation of each element ofinput.DigestBuilderupdate(java.lang.String input)Update the digest input with bytes frominputinStandardCharsets.UTF_8encoding.DigestBuilderupdate(java.lang.String input, java.nio.charset.Charset charset)Update the digest input with bytes frominputincharsetencoding.
 
- 
- 
- 
Method Detail- 
md5public static DigestBuilder md5() - Returns:
- a DigestBuilderthat uses the MD5 algorithm.
 
 - 
sha1public static DigestBuilder sha1() - Returns:
- a DigestBuilderthat uses the SHA-1 algorithm.
 
 - 
sha256public static DigestBuilder sha256() - Returns:
- a DigestBuilderthat uses the SHA-256 algorithm.
 
 - 
custompublic static DigestBuilder custom(java.lang.String algorithm) throws java.security.NoSuchAlgorithmException - Parameters:
- algorithm- the message digest algorithm.
- Returns:
- a DigestBuilderthat usesalgorithm.
- Throws:
- java.security.NoSuchAlgorithmException- if no message digest for- algorithmis available.
 
 - 
updatepublic DigestBuilder update(java.lang.String input) Update the digest input with bytes frominputinStandardCharsets.UTF_8encoding.- Parameters:
- input- the input String.
- Returns:
- this DigestBuilder.
 
 - 
updatepublic DigestBuilder update(java.lang.String input, java.nio.charset.Charset charset) Update the digest input with bytes frominputincharsetencoding.- Parameters:
- input- the input String.
- charset- the encoding- Charset.
- Returns:
- this DigestBuilder.
 
 - 
updatepublic DigestBuilder update(boolean input) Update the digest input withinput.If true, a byte equal to 1, otherwise 0.- Parameters:
- input- the input boolean.
- Returns:
- this DigestBuilder.
 
 - 
updatepublic DigestBuilder update(byte input) Update the digest input withinput.- Parameters:
- input- the inpute byte.
- Returns:
- this DigestBuilder.
 
 - 
updatepublic DigestBuilder update(short input) Update the digest input with the bytes from the big-endian representation ofinput.- Parameters:
- input- the input short.
- Returns:
- this DigestBuilder.
 
 - 
updatepublic DigestBuilder update(int input) Update the digest input with the bytes from the big-endian representation ofinput.- Parameters:
- input- the input int.
- Returns:
- this DigestBuilder.
 
 - 
updatepublic DigestBuilder update(long input) Update the digest input with the bytes from the big-endian representation ofinput.- Parameters:
- input- the input long.
- Returns:
- this DigestBuilder.
 
 - 
updatepublic DigestBuilder update(float input) Update the digest input with the bytes from the big-endian representation ofinput's raw int bits.- Parameters:
- input- the input float.
- Returns:
- this DigestBuilder.
 
 - 
updatepublic DigestBuilder update(double input) Update the digest input with the bytes from the big-endian representation ofinput's raw long bits.- Parameters:
- input- the input double.
- Returns:
- this DigestBuilder.
 
 - 
updatepublic DigestBuilder update(byte[] input) Update the digest input with the bytes from the big-endian representation of each element ofinput.- Parameters:
- input- the input array.
- Returns:
- this DigestBuilder.
 
 - 
updatepublic DigestBuilder update(short[] input) Update the digest input with the bytes from the big-endian representation of each element ofinput.- Parameters:
- input- the input array.
- Returns:
- this DigestBuilder.
 
 - 
updatepublic DigestBuilder update(int[] input) Update the digest input with the bytes from the big-endian representation of each element ofinput.- Parameters:
- input- the input array.
- Returns:
- this DigestBuilder.
 
 - 
updatepublic DigestBuilder update(long[] input) Update the digest input with the bytes from the big-endian representation of each element ofinput.- Parameters:
- input- the input array.
- Returns:
- this DigestBuilder.
 
 - 
updatepublic DigestBuilder update(float[] input) Update the digest input with the bytes from the big-endian representation of each element ofinput.- Parameters:
- input- the input array.
- Returns:
- this DigestBuilder.
 
 - 
updatepublic DigestBuilder update(double[] input) Update the digest input with the bytes from the big-endian representation of each element ofinput.- Parameters:
- input- the input array.
- Returns:
- this DigestBuilder.
 
 - 
resetpublic DigestBuilder reset() Manually reset the underlyingMessageDigest.This is done automatically after a call to build()orbuildHexString().- Returns:
- this DigestBuilder.
 
 - 
buildpublic byte[] build() Compute and return the digest.The underlying MessageDigestis reset and this builder can be re-used.- Returns:
- the computed digest.
 
 - 
buildHexStringpublic java.lang.String buildHexString() Compute and return the digest as a lower-case hex-encoded String.The underlying MessageDigestis reset and this builder can be re-used.- Returns:
- the computed digest as a lower-case hex-encoded String.
 
 
- 
 
-