i have php code to validate btc address! but i need code for vb.net please help ... some time php code is not loading... anyone help me to give me code for vb.net??? php code is below can anyone do code for vb.net? like the php code below?? may i know how to validate bitcoin address using vb.net? i just tried with validating btc address with php! its working fine but i need code for vb.net
<pre><?php function validate($address){ $decoded = decodeBase58($address); $d1 = hash("sha256", substr($decoded,0,21), true); $d2 = hash("sha256", $d1, true); if(substr_compare($decoded, $d2, 21, 4)){ throw new \Exception("invalid Address"); } return true; } function decodeBase58($input) { $alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; $out = array_fill(0, 25, 0); for($i=0;$i<strlen($input);$i++){ if(($p=strpos($alphabet, $input[$i]))===false){ throw new \Exception("invalid character found"); } $c = $p; for ($j = 25; $j--; ) { $c += (int)(58 * $out[$j]); $out[$j] = (int)($c % 256); $c /= 256; $c = (int)$c; } if($c != 0){ throw new \Exception("This is Not Bitcoin Address"); } } $result = ""; foreach($out as $val){ $result .= chr($val); } return $result; } function main () { $s = array($_GET['WalletAdd']); foreach($s as $btc){ $message = "Valid Address"; try{ validate($btc); }catch(\Exception $e){ $message = $e->getMessage(); } echo "$message\n"; } } main(); ?>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)