c# - How can I check hash generated Cryptonight before to send? -


i have made miner c# language make bcn, xmr , works pools.

but want check hash generated code target received pool.

i have made that:

      public bool checkhash(byte[] hash, byte[] target)       {         (int = 0; < target.length; i++)         {             (int k = hash.length-1; k >= 0; k--)             {                 log("test de: " + (hash[k] & 0x20));                 if ((hash[k] & 0x20) > (target[i] & 0x04))                 {                     log("hash invalid: " + _cryptonightlib.tohexstring(hash));                     return false;                 }                 if ((hash[k] & 0x20) < (target[i] & 0x04))                 {                     log("hash valid: " + _cryptonightlib.tohexstring(hash));                     return true;                 }             }         }         log("hash invalid: "+_cryptonightlib.tohexstring(hash));         return false;      } 

but not work.

example origin hash received on miner: 0505efcfdccb0506180897d587b02f9c97037e66ea638990b2b3a0efab7bab0bff4e3f3dfe1c7d00000000a6788e66eb9b82325f95fc7a2007d3fed7152a3590366cc2a9577dcadf3544a804

example hash generated , send miner: 960a7a3a1826b0aa70e8043ffe7b9e23ee2e028bba75f3d7557ccdff9c7f1a00

example target: e4a63d00

thank in advance.


Comments

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -