Class Nonce
java.lang.Object
org.drasyl.handler.remote.protocol.Nonce
A
RemoteMessage is uniquely identified by its NONCE_LENGTH bytes long nonce.
This is an immutable object.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()static booleanisValidNonce(ImmutableByteArray bytes) Checks ifbytesis a valid value.static Nonceof(byte[] bytes) static Noncestatic Nonceof(ImmutableByteArray bytes) static NonceStatic factory to retrieve a randomly generatedNonce.byte[]toString()
-
Field Details
-
NONCE_LENGTH
public static final int NONCE_LENGTH- See Also:
-
-
Method Details
-
toString
-
toByteArray
public byte[] toByteArray() -
toImmutableByteArray
-
equals
-
hashCode
public int hashCode() -
randomNonce
Static factory to retrieve a randomly generatedNonce.- Returns:
- A randomly generated
Nonce
-
isValidNonce
Checks ifbytesis a valid value.- Parameters:
bytes- string to be validated- Returns:
trueif valid. Otherwisefalse
-
of
- Throws:
NullPointerException- ifbytesisnull
-
of
- Throws:
NullPointerException- ifbytesisnull
-
of
- Throws:
NullPointerException- ifbytesisnull
-