Post
Topic
Board Bitcoin Discussion
Re: Losing Critical Mass and Call to Action
by
mizerydearia
on 13/09/2010, 06:36:17 UTC
Another thing that would help bitcoin adoption:

python, perl, php libraries and common code for interfacing with bitcoin.

For example, Perl or Python code that verifies that "17NdbrSGoUotzeGCcMMCqnFkEvLymoou9j" is a valid bitcoin address, and "098123409813lkjasdflkjasdflk" is not, would be useful to anyone wishing to implement a bitcoin web interface.


Hummm, well, I didn't have any luck finding how to determine what constitutes as an address examining the c++ code, but here's a PHP function that should work as expected:

Code:
function is_bitcoin_address($address) { return preg_match("/1[1-9A-HJ-NP-Za-km-z]{32,33}/", $address); }
if (is_bitcoin_address("17NdbrSGoUotzeGCcMMCqnFkEvLymoou9j")) echo "yes";
else echo "no";
?>

Ah yes, thanks for clarifying theymos.  I updated my code.  I confirmed and of all of my addresses they contain at least one of all alphanumberic characters except 0, I, O and l.