Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
sub-encoder
Advanced tools
Generate sub encodings for key/value stores
const enc = new SubEncoder()
const subA = enc.sub('sub-a')
const subB = enc.sub('sub-b', 'binary') // subs support custom key encodings
await bee.put('k1', 'b')
await bee.put('a1', 'a1', { keyEncoding: subA })
await bee.put('b1', 'b1', { keyEncoding: subB })
// k1 as normal
await bee.get('k1')
// a1 from the sub
await bee.get('a1', { keyEncoding: subA })
// also supports read streams
for await (const node of bee.createReadStream({ keyEncoding: subA })) {
// Iterates everything in the A sub
}
// The range options will be encoded properly too
for await (const node of bee.createReadStream({ lt: 'b2' }, { keyEncoding: subB })) {
}
const enc = new SubEncoder([prefix, encoding])
Create a new SubEncoder. Optionally set the initial prefix and encoding.
prefix
can be string or Buffer. If set, acts as an initial sub instead of starting at the Hyperbee's base level.
subEnc = enc.sub(prefix, [encoding])
Make a new sub. Returns a SubEncoder, so subs can easily be nested.
prefix
can be string or Buffer.
buf = enc.encode(key)
Encode a key.
key = enc.decode(buf)
Decode a key.
encodedRange = enc.encodeRange(range)
Encode a range.
Apache-2.0
FAQs
Generate sub encodings for key/value stores
The npm package sub-encoder receives a total of 1,766 weekly downloads. As such, sub-encoder popularity was classified as popular.
We found that sub-encoder demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.