Post
Topic
Board Bitcoin Technical Support
Re: regex for bitcointransaction string
by
telepatheic
on 26/05/2014, 20:38:29 UTC
I got a string containing the "txid" which should be checked.

All the best;
the txid is the sha-1 hash of a transaction. you can't use the txid to determine whether a transaction is valid, because any 64 digit hexadecimal number can be a txid.

It's not the SHA-1 it is the SHA256d. Also quite confusingly, the output bytes are reversed when displayed to the user!

The RegEx you are looking for is:

Code:
/^[0-9a-f]{64}$/i