mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-07 11:29:58 +08:00
16 lines
260 B
JavaScript
16 lines
260 B
JavaScript
|
|
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
|