Skip to content
This repository was archived by the owner on Aug 24, 2021. It is now read-only.

Commit 7f9c6d1

Browse files
satazorhugomrdias
authored andcommitted
fix: use Buffer.from instead of the deprecated new Buffer (#36)
1 parent f7142c9 commit 7f9c6d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ You will need to use Node.js `Buffer` API compatible, if you are running inside
8585

8686
```js
8787
const multihashing = require('multihashing-async')
88-
const buf = new Buffer('beep boop')
88+
const buf = Buffer.from('beep boop')
8989

9090
multihashing(buf, 'sha1', (err, multihash) => {
9191
// by default calls back with a multihash.
@@ -109,7 +109,7 @@ h(buf, (err, digest) => {
109109

110110
```js
111111
> const multihashing = require('multihashing-async')
112-
> const buf = new Buffer('beep boop')
112+
> const buf = Buffer.from('beep boop')
113113

114114
> multihashing(buf, 'sha1', (err, mh) => console.log(mh))
115115
// => <Buffer 11 14 7c 83 57 57 7f 51 d4 f0 a8 d3 93 aa 1a aa fb 28 86 3d 94 21>

0 commit comments

Comments
 (0)