Browse Source

Merge pull request #122 from dcousens/fix121

Pads zeros in toBytes output, fixes #121
hk-custom-address
Wei Lu 11 years ago
parent
commit
97575e8f46
  1. 4
      src/eckey.js

4
src/eckey.js

@ -85,6 +85,10 @@ ECKey.prototype.toHex = function() {
ECKey.prototype.toBytes = function() {
var bytes = this.priv.toByteArrayUnsigned()
// ensure 32 bytes
while (bytes.length < 32) bytes.unshift(0)
if (this.compressed) bytes.push(1)
return bytes
}

Loading…
Cancel
Save