MidnightLightning/bitcoinjs-server — pull request #2 by statefull (2014-01-02 23:53:53+00:00)
Title: Updated lib/util.js for avoiding TypeError: Not a string or buffer

Avoid error TypeError: Not a string or buffer when calling api request pubkeys/register?keys=

Explanation:

In addressToPubKeyHash decoding a base58 address (bitcoin address) returns a byte array but twoSha256, concretely, sha256 requires a string or a buffer, so, to avoid errors performing sha256, the returned byte array is converted to a buffer.