Package org.drasyl.identity
Class ProofOfWork
java.lang.Object
org.drasyl.identity.ProofOfWork
This class models the proof of work for a given public key. Hence, identity creation becomes an
expensive operation and sybil attacks should be made more difficult.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic ProofOfWorkgenerateProofOfWork(CompressedPublicKey publicKey, short difficulty) static shortgetDifficulty(ProofOfWork proofOfWork, CompressedPublicKey publicKey) intgetNonce()inthashCode()voidincNonce()intintValue()Returns the value of thisProofOfWorkas anint.booleanisValid(CompressedPublicKey publicKey, short difficulty) static ProofOfWorkof(int nonce) toString()
-
Method Details
-
hashCode
public int hashCode() -
equals
-
toString
-
getNonce
public int getNonce() -
intValue
public int intValue()Returns the value of thisProofOfWorkas anint. -
of
-
generateProofOfWork
-
isValid
-
getDifficulty
-
incNonce
public void incNonce()
-