Bitcoin Forum
June 29, 2024, 10:48:11 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: JAVA LTC miner target comparing question  (Read 579 times)
Geir (OP)
Full Member
***
Offline Offline

Activity: 546
Merit: 100



View Profile
December 22, 2013, 11:00:06 PM
 #1

Hi!

I've been looking at the code for a LTC miner written in java(https://github.com/pooler/JMiner). And have a question

Is the way he compares the target and hash correct? I thought you had to compare them as numbers not individual bits

Code:
 
 for (int i = hash.length - 1; i >= 0; i--) {
                        if ((hash[i] & 0xff) > (target[i] & 0xff))
                                return false;
                        if ((hash[i] & 0xff) < (target[i] & 0xff))
                                return true;
                }
                return true;

The whole code https://github.com/pooler/JMiner/blob/master/src/org/litecoinpool/miner/Work.java

TOP Network   Enable real-world business with Blockchain 4.0 technology  |
–––––––   Whitepaper   |   Twitter   |   Facebook   |   Linkedln   |   Telegram   |   Medium  –––––––
|   No Transaction Fee   |   300K TPS   |   50 Million Active Users   |
Geir (OP)
Full Member
***
Offline Offline

Activity: 546
Merit: 100



View Profile
January 09, 2014, 06:20:48 PM
 #2

Does any one know this?

TOP Network   Enable real-world business with Blockchain 4.0 technology  |
–––––––   Whitepaper   |   Twitter   |   Facebook   |   Linkedln   |   Telegram   |   Medium  –––––––
|   No Transaction Fee   |   300K TPS   |   50 Million Active Users   |
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!