public interface Digester
Modifier and Type | Method and Description |
---|---|
byte[] |
digest(byte[] source)
Digests an item serialized as an array of bytes.
|
byte[] digest(byte[] source)
Any byte array value must be accepted and have a non null
return value: for any a
,
digest(a) != null
.
All valid inputs should produce in output an array of the same size:for any a1
and
a2
, digest(a1).length == digest(a2).length
.
The output must be consistent, an identical output should be returned if called twice on the same array: for
any a1
and a2
, Arrays.equals(a1, a2)
implies
Arrays.equals(digest(a1), digest(a2))
.
In addition to those constrains, it is recommended that it has the properties of a cryptographic hash function.
source
- the item serialized as an array of bytes.IllegalArgumentException
- if the input array is null
.Copyright © 2014. All rights reserved.