npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

rabin-native

1.0.1

@mafintosh

npmHomeRepoSnykSocket
Downloads:150
$ npm install rabin-native
DailyWeeklyMonthlyYearly

rabin-native

Native bindings for rabin-cdc

npm install rabin-native

Usage

const Rabin = require('rabin-native')

const r = new Rabin()

const chunks = r.push(Buffer.from('some chunk of data'))

for (let i = 0; i < chunks; i++) {
  console.log('chunk length: ' + r.chunks[i])
}

API

rabin = new Rabin()

Makes a new rabin instance

chunkCount = rabin.push(buffer)

Push data to the chunker. Returns the amount of chunks found.

rabin.chunks

A Uint32Array containing the length of the chunks found.

chunks = rabin.finalise()

Finalises the chunker. Call this when your input stream is done. Returns the remaining chunk count.

License

MIT