Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@bitrelay/bufio
Advanced tools
Buffer and serialization utilities for node.js and browser.
npm install @bitrelay/bufio
import * as assert from 'assert'
import * as bufio from '@bitrelay/bufio'
const bw = bufio.write()
bw.writeU64(100)
bw.writeString('foo')
const data = bw.render()
const br = bufio.read(data)
assert(br.readU64() === 100)
assert(br.readString(3) === 'foo')
import { BufferReader, BufferWriter, Struct } from '@bitrelay/bufio'
class MyStruct extends Struct {
public str: string
public value: number
constructor(data: Partial<MyStruct> = {}) {
super()
Object.assign(this, data)
}
public static fromReader(br: BufferReader): MyStruct {
const str = br.readVarString('ascii')
const value = br.readU64()
return new this({ str, value })
}
public toWriter(bw: BufferWriter): BufferWriter {
bw.writeVarString(this.str, 'ascii')
bw.writeU64(this.value)
return bw
}
}
const instance = new MyStruct({ str: 'hello', value: 0 })
console.log('Buffer:')
console.log(instance.toBuffer())
console.log('Decoded:')
console.log(MyStruct.fromBuffer(instance.toBuffer()))
console.log('Hex:')
console.log(instance.toHex())
console.log('Decoded:')
console.log(MyStruct.fromHex(instance.toHex()))
console.log('Base64:')
console.log(instance.toBase64())
console.log('Decoded:')
console.log(MyStruct.fromBase64(instance.toBase64()))
If you contribute code to this project, you are implicitly allowing your code
to be distributed under the MIT license. You are also implicitly verifying that
all code is your original work. </legalese>
See LICENSE for more info.
FAQs
Buffer and serialization utilities
The npm package @bitrelay/bufio receives a total of 2 weekly downloads. As such, @bitrelay/bufio popularity was classified as not popular.
We found that @bitrelay/bufio 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.