You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415
  1. function incr32 (iv) {
  2. var len = iv.length
  3. var item
  4. while (len--) {
  5. item = iv.readUInt8(len)
  6. if (item === 255) {
  7. iv.writeUInt8(0, len)
  8. } else {
  9. item++
  10. iv.writeUInt8(item, len)
  11. break
  12. }
  13. }
  14. }
  15. module.exports = incr32