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
				
				260 B
			
		
		
			
		
	
	
					16 lines
				
				260 B
			| 
								 
											4 years ago
										 
									 | 
							
								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
							 |