Bitcoin Forum
May 08, 2024, 06:12:13 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Help to understand part of algorithm in excel  (Read 907 times)
coinscashout (OP)
Jr. Member
*
Offline Offline

Activity: 45
Merit: 1


View Profile
August 30, 2015, 10:17:07 PM
 #1

I'm keen on understanding how the algorithm works. I've understood bits and bobs via https://www.youtube.com/watch?v=UZBZPOEVyJA and the excel file associated with it.

I am struggling to understand what these values mean in excel however:

MID(HEX2BIN(IF(ISERROR(MID(D13,LEN(D13),1)),0, MID(D13,LEN(D13),1)),4),4,1)

I get what hex2bin means (hex to binary) but what does the rest actually mean? Am I right in assuming "mid" would mean middle range or something similar.

Please help if you have a better understanding of the formula and bitcoin algo
1715148733
Hero Member
*
Offline Offline

Posts: 1715148733

View Profile Personal Message (Offline)

Ignore
1715148733
Reply with quote  #2

1715148733
Report to moderator
"Bitcoin: mining our own business since 2009" -- Pieter Wuille
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715148733
Hero Member
*
Offline Offline

Posts: 1715148733

View Profile Personal Message (Offline)

Ignore
1715148733
Reply with quote  #2

1715148733
Report to moderator
1715148733
Hero Member
*
Offline Offline

Posts: 1715148733

View Profile Personal Message (Offline)

Ignore
1715148733
Reply with quote  #2

1715148733
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6631


Just writing some code


View Profile WWW
August 30, 2015, 10:46:01 PM
 #2

I'm keen on understanding how the algorithm works. I've understood bits and bobs via https://www.youtube.com/watch?v=UZBZPOEVyJA and the excel file associated with it.

I am struggling to understand what these values mean in excel however:

MID(HEX2BIN(IF(ISERROR(MID(D13,LEN(D13),1)),0, MID(D13,LEN(D13),1)),4),4,1)

I get what hex2bin means (hex to binary) but what does the rest actually mean? Am I right in assuming "mid" would mean middle range or something similar.

Please help if you have a better understanding of the formula and bitcoin algo
MID is actually taking a substring with these parameters
Code:
MID( text, start_position, number_of_characters )


So lets start with
Code:
 IF(ISERROR(MID(D13,LEN(D13),1)),0, MID(D13,LEN(D13),1))
This chunk of code means
Code:
If the last character of D13(substring of 1 character starting at the character at the length of D13) is an error, then output is 0. Otherwise the output is the last character
The output of the if statement goes into HEX2BIN which takes paramters
Code:
HEX2BIN(number, [places])
where number is the number and places is the number of characters to use. In this case, 4.

The remaining code comes out to mean
Code:
The substring of the output of the 4 character hex to bin conversion of the last character of D13 or 0 starting at the 4th character with a size of 1 character.

Basically it is taking the last character of the binary output of either the last character of D13 or 0.

coinscashout (OP)
Jr. Member
*
Offline Offline

Activity: 45
Merit: 1


View Profile
August 31, 2015, 06:21:17 PM
 #3

Thank you very much for your help
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!