Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Commit

Permalink
Replace toBuffer with toArrayLike
Browse files Browse the repository at this point in the history
  • Loading branch information
vpulim committed Oct 25, 2018
1 parent d64c302 commit 502a039
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const blockHashPrefix = new Buffer('H') // blockHashPrefix + hash -> number
const bodyPrefix = new Buffer('b') // bodyPrefix + number + hash -> block body

// utility functions
const bufBE8 = n => n.toBuffer('be', 8) // convert BN to big endian Buffer
const bufBE8 = n => n.toArrayLike(Buffer, 'be', 8) // convert BN to big endian Buffer
const tdKey = (n, hash) => Buffer.concat([headerPrefix, bufBE8(n), hash, tdSuffix])
const headerKey = (n, hash) => Buffer.concat([headerPrefix, bufBE8(n), hash])
const bodyKey = (n, hash) => Buffer.concat([bodyPrefix, bufBE8(n), hash])
Expand Down

0 comments on commit 502a039

Please sign in to comment.