mirror of
https://github.com/cp6/my-idlers.git
synced 2024-11-16 23:42:32 +01:00
fd22b0bf58
V2 (Laravel re-make)
16 lines
260 B
JavaScript
Vendored
16 lines
260 B
JavaScript
Vendored
function incr32 (iv) {
|
|
var len = iv.length
|
|
var item
|
|
while (len--) {
|
|
item = iv.readUInt8(len)
|
|
if (item === 255) {
|
|
iv.writeUInt8(0, len)
|
|
} else {
|
|
item++
|
|
iv.writeUInt8(item, len)
|
|
break
|
|
}
|
|
}
|
|
}
|
|
module.exports = incr32
|