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.
16 lines
321 B
16 lines
321 B
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;
|
|
}
|
|
}
|
|
}
|
|
export default incr32;
|
|
|