PHP 8.2.30
Preview: QRBitBuffer.js Size: 702 B
/proc/thread-self/root/lib/node_modules/npm/node_modules/qrcode-terminal/vendor/QRCode/QRBitBuffer.js

function QRBitBuffer() {
	this.buffer = [];
	this.length = 0;
}

QRBitBuffer.prototype = {

	get : function(index) {
		var bufIndex = Math.floor(index / 8);
		return ( (this.buffer[bufIndex] >>> (7 - index % 8) ) & 1) == 1;
	},
	
	put : function(num, length) {
		for (var i = 0; i < length; i++) {
			this.putBit( ( (num >>> (length - i - 1) ) & 1) == 1);
		}
	},
	
	getLengthInBits : function() {
		return this.length;
	},
	
	putBit : function(bit) {
	
		var bufIndex = Math.floor(this.length / 8);
		if (this.buffer.length <= bufIndex) {
			this.buffer.push(0);
		}
	
		if (bit) {
			this.buffer[bufIndex] |= (0x80 >>> (this.length % 8) );
		}
	
		this.length++;
	}
};

module.exports = QRBitBuffer;

Directory Contents

Dirs: 0 × Files: 10

Name Size Perms Modified Actions
10.42 KB lrw-r--r-- 2021-03-10 14:36:36
Edit Download
382 B lrw-r--r-- 2021-03-10 14:36:36
Edit Download
702 B lrw-r--r-- 2021-03-10 14:36:36
Edit Download
54 B lrw-r--r-- 2021-03-10 14:36:36
Edit Download
157 B lrw-r--r-- 2021-03-10 14:36:36
Edit Download
673 B lrw-r--r-- 2021-03-10 14:36:36
Edit Download
149 B lrw-r--r-- 2021-03-10 14:36:36
Edit Download
1.30 KB lrw-r--r-- 2021-03-10 14:36:36
Edit Download
5.43 KB lrw-r--r-- 2021-03-10 14:36:36
Edit Download
8.03 KB lrw-r--r-- 2021-03-10 14:36:36
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).