bitpay/bitcore — pull request #163 by ecto (2014-03-16 05:13:14+00:00)
Title: Allow stringToBuffer to parse hex without preceding length byte

Script.stringToBuffer, given the following script

````
DUP HASH160 0x8f90da6b92b76c353cec6b8876d1bc004b6f1fd9 EQUALVERIFY CHECKSIG
````

would erroneously parse it as

````
{ buffer: ,
chunks:
[ 118,
169,
80,
172,
] }
````

or as the output of toHumanReadable,

````
DUP HASH160 NEGATE ABS 0xda TOALTSTACK 0NOTEQUAL NOP8 FROMALTSTACK 0x0e 0x3cec6b8876d1bc004b6f1fd988ac
````

It was assuming that because there was an `0x` in front of the string it was an output of toHumanReadable and there would be a preceding length chunk. My change pushes the length chunk if it isn't already there.

My database currently has scripts in the form of my input example which I know I shouldn't be doing and this change was easier than running a query over gigabytes of data to remove `0x`. I suppose it isn't an important change for the project - no worries if you don't want to merge.

I would have written tests, but you guys don't have any docs and I'm eating pizza.