indutny / bn.js

BigNum in pure javascript

Repository from Github https://github.comindutny/bn.jsRepository from Github https://github.comindutny/bn.js

The unit of length in `toBuffer(endian, length)` is unclear

TimDaub opened this issue · comments

see readme.md:

a.toBuffer(endian, length) - convert to Node.js Buffer (if available). For compatibility with browserify and similar tools, use this instead: a.toArrayLike(Buffer, endian, length)

But what unit is length? My guess would be either bytes or bits?

Edit: Looking at the code it's probably bytes