The above check always returns false, since it's missing .length, so the buffer copy/padding is never performed. Luckily/Accidentally accessing an out-of-index array in Javascript returns an undefined type that has the same property of a 0, in regard of the XOR operation.
https://github.com/bitpay/bitcore-lib/blob/026ddb4d393ee5f1daa2688483a13e274d5df3ed/lib/crypto/hash.js#L56
The above check always returns
false
, since it's missing.length
, so the buffer copy/padding is never performed. Luckily/Accidentally accessing an out-of-index array in Javascript returns anundefined
type that has the same property of a 0, in regard of the XOR operation.