Bitcoin Forum
May 26, 2018, 01:27:26 AM
 News: Latest stable version of Bitcoin Core: 0.16.0  [Torrent]. (New!)
 Home Help Search Donate Login Register
 Pages: [1]
 Author Topic: Help to understand part of algorithm in excel  (Read 848 times)
coinscashout
Jr. Member

Offline

Activity: 45
Merit: 0

 August 30, 2015, 10:17:07 PM

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.

1527298046
Hero Member

Offline

Posts: 1527298046

Ignore
 1527298046

1527298046
 Report to moderator
1527298046
Hero Member

Offline

Posts: 1527298046

Ignore
 1527298046

1527298046
 Report to moderator
1527298046
Hero Member

Offline

Posts: 1527298046

Ignore
 1527298046

1527298046
 Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1527298046
Hero Member

Offline

Posts: 1527298046

Ignore
 1527298046

1527298046
 Report to moderator
achow101
Moderator
Legendary

Offline

Activity: 1414
Merit: 1329

 August 30, 2015, 10:46:01 PM

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.

MID is actually taking a substring with these parameters
Code:
MID( text, start_position, number_of_characters )

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
Jr. Member

Offline

Activity: 45
Merit: 0

 August 31, 2015, 06:21:17 PM

Thank you very much for your help
 Pages: [1]