bitcoinjs/bitcoinjs-lib — pull request #97 by dcousens (2014-03-26 07:36:52+00:00)
Title: Adds varIntToNum conversion function

As suggested in #94, this pull request adds `varIntToNum` as a conversion function.

This should be used in place of `readVarInt` in [Transaction.deserialize](https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/src/transaction.js#L256-L262), which currently is reading `253 - 251` bytes in the 16-bit case, `254 - 251` bytes in the 32-bit case, and `255 - 251` bytes in the 64-bit case; that is, the wrong amount of bytes in all but the 8-bit and 16-bit cases.