Browse Source

Use `Buffer.from()` instead of `new Buffer()`

patch-1
Luke Childs 7 years ago
committed by GitHub
parent
commit
dce2ee08eb
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      docs/examples.md

2
docs/examples.md

@ -14,7 +14,7 @@ console.log(address.toString()) // 15WZwpw3BofscM2u43ji85BXucai5YGToL
```javascript
const bch = require('bitcoincashjs');
const value = new Buffer('Bitcoin Cash - Peer-to-Peer Electronic Cash');
const value = Buffer.from('Bitcoin Cash - Peer-to-Peer Electronic Cash');
const hash = bch.crypto.Hash.sha256(value);
const bn = bch.crypto.BN.fromBuffer(hash);
const address = new bch.PrivateKey(bn).toAddress();

Loading…
Cancel
Save