Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A simple set of functions for converting between integer and VLQ buffer values
A simple set of functions for converting between integer and VLQ buffer values
$ npm install --save vlq-buffer
var vlqBuffer = require('vlq-buffer');
This method converts an integer to a Buffer containing the VLQ representation of that integer.
var myInt = 2097151;
var bufferValue = vlqBuffer.int2VLQBuffer(myInt);
// bufferValue == <Buffer ff ff 7f>
This method converts a Buffer containing a VLQ value to an integer.
var myVLQValue = new Buffer([0x81, 0x80, 0x00]);
var intValue = vlqBuffer.vlqBuffer2Int(myVLQValue);
// intValue == 16384
This method returns true if the given integer's binary value starts with zero, indicating tne end of the VLQ value. This is useful for identifying the final byte in a VLQ value when reading binary data.
var vlqStartIndex = readIndex; // start reading a vlq value and the current read index
var currentByte = bufferData.readUInt8(readIndex);
while (!vlqBuffer.isVLQLastByte(currentByte)) {
if (++readIndex >= bufferData.length) throw 'EOF error'; // EOF, no vql end found
currentByte = bufferData.readUInt8(readIndex);
}
var vlqValueBytes = bufferData.slice(vlqStartIndex, ++readIndex);
var intValue = vlq.vlqBuffer2Int(vlqValueBytes);
FAQs
A simple set of functions for converting between integer and VLQ buffer values
The npm package vlq-buffer receives a total of 1 weekly downloads. As such, vlq-buffer popularity was classified as not popular.
We found that vlq-buffer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.