
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
@telemok/ring-buffer-uint8array
Advanced tools
Typescript circular ring buffer uint8array with push shift read write find operations
https://npmjs.com/package/@telemok/ring-buffer-uint8array is the typescript circular ring buffer uint8array with .push .shift .read .write find operations
import {RingBufferUint8Array} from "@telemok/RingBufferUint8Array"
const textEncoder = new TextEncoder();
const textDecoder = new TextDecoder();
/* Create instance of RingBuffer */
let rb = new RingBufferUint8Array(10);
/* Data to parse, like streaming from UART. */
const inputStream = "Hello\r\nworld! May be.";
/* Separators to split data. */
const binarySeparators = [textEncoder.encode('\r\n'), textEncoder.encode('!')];
/* Iterate stream data.*/
for(let c of inputStream)
{
/* Push bytes from stream. */
rb.pushByte(textEncoder.encode(c)[0]);
/* Extract Uint8array from ringbuffer without separator if separator match or return null. */
let arr = rb.ifEndsWithUint8ArraysThenFlushUint8Array(binarySeparators, false);
if(arr !== null)
console.log("Find: ", textDecoder.decode(arr));
}
It will return:
Find: Hello
Find: world
FAQs
Typescript circular ring buffer uint8array with push shift read write find operations
We found that @telemok/ring-buffer-uint8array 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
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.