increment a buffer (with carry)
npm install increment-bufferincrement a buffer (with carry)
Useful for managing nonces when using libsodium
In particular, see Notes section regarding reusing keys (scroll to bottom)
`` js
> var inc = require('increment-buffer')
> inc(new Buffer([0, 0, 0, 0]))
> //with carry...
> inc(new Buffer([0, 0, 0, 255]))
> //wrap around
> inc(new Buffer([255, 255, 255, 255]))
``
MIT