Bitcoin Forum
December 18, 2017, 05:35:00 PM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Help to understand part of algorithm in excel  (Read 848 times)
coinscashout
Jr. Member
*
Offline Offline

Activity: 45


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
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1513618500
Hero Member
*
Offline Offline

Posts: 1513618500

View Profile Personal Message (Offline)

Ignore
1513618500
Reply with quote  #2

1513618500
Report to moderator
1513618500
Hero Member
*
Offline Offline

Posts: 1513618500

View Profile Personal Message (Offline)

Ignore
1513618500
Reply with quote  #2

1513618500
Report to moderator
1513618500
Hero Member
*
Offline Offline

Posts: 1513618500

View Profile Personal Message (Offline)

Ignore
1513618500
Reply with quote  #2

1513618500
Report to moderator
achow101
Moderator
Legendary
*
Offline Offline

Activity: 1246


17kKQppUsngUiByDsce4JXoZEjjpvX9bpR


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

Activity: 45


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

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

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!