Author

Topic: Advanced users (Read 773 times)

hero member
Activity: 740
Merit: 501
April 21, 2013, 05:37:36 PM
#6
Solved
member
Activity: 110
Merit: 10
April 21, 2013, 04:39:44 PM
#5
When asking for help it is useful to explain what you are trying to do, what you expected to happen, what really happened, how you are able to replicate it, etc.
hero member
Activity: 740
Merit: 501
April 21, 2013, 04:00:31 PM
#4
The logic behind these posts amazes me, it's like where does this kind of douchebaggery and need to prove oneself to be more smart than the peers arises.

You open a topic.
There is instantly a reply from a person giving criticism of the structure of the code or the language itself EVEN though is unable to answer the question.
You point out the hypocrisy of the situation to the person only to get a reply along the lines of "I know the answer but I won't tell it to you blah blah".

Back to 4chan/stackoverflow plz, people actually solve problems here,
hero member
Activity: 740
Merit: 501
April 21, 2013, 03:16:43 PM
#3
It's PHP


Well played  Grin

But could you point out how I get the address that signed that input properly?
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
April 21, 2013, 02:35:24 PM
#2
It's PHP
hero member
Activity: 740
Merit: 501
April 21, 2013, 02:28:20 PM
#1
Code:
  
  $arr = GetTx($client,$myAddress);
  $RawTx = $client->getrawtransaction($arr,1);
  $pieces = explode(" ", $RawTx["vin"][0]["scriptSig"]["asm"]);
  $myHash = hash('ripemd160',hash('sha256',$pieces[1]));
  $myHashStr = chr(0x00).$myHash;
  $myHash2 = hash('sha256',hash('sha256',$myHashStr));
  $myHashStr.=substr($myHash2,0,4);
  echo "Hash:".$myHashStr."
";
  echo "Base58:".base58_encode($myHashStr)."
";

function base58_encode($num) {
    $alphabet = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ';
    $base_count = strlen($alphabet);
    $encoded = '';
    while ($num >= $base_count) {
        $div = $num / $base_count;
        $mod = ($num - ($base_count * intval($div)));
        $encoded = $alphabet[$mod] . $encoded;
        $num = intval($div);
    }
    if ($num) {$encoded = $alphabet[$num] . $encoded;}
    return $encoded;
}

What is wrong with this code?
Jump to: