Translations: Forging (f)/7/en

From ArdorDocs
Jump to: navigation, search
private static BigInteger getHit(byte[] publicKey, Block block){
   [...]
   MessageDigest digest = Crypto.sha256();
   digest.update(block.getGenerationSignature());
   byte[] generationSignatureHash = digest.digest(publicKey);
   return new BigInteger(1, new byte[] {generationSignatureHash[7], 
                                        generationSignatureHash[6], 
                                        generationSignatureHash[5], 
                                        generationSignatureHash[4], 
                                        generationSignatureHash[3], 
                                        generationSignatureHash[2], 
                                        generationSignatureHash[1], 
                                        generationSignatureHash[0]});
}

Taken from ardor/ src / java / nxt / Generator.java