katoikia-app/web-ui/web-react/node_modules/browserify-aes/incr32.js

16 lines
260 B
JavaScript
Raw Normal View History

2022-07-06 04:15:11 +00:00
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