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

Made by Antonio Ramirez

pull-bitflipper

0.1.1

@dominictarr

npmHomeRepoSnykSocket
Downloads:45
$ npm install pull-bitflipper
DailyWeeklyMonthlyYearly

pull-bitflipper

pull stream that randomly flips bits in input stream, useful for testing authenticated cryptography.

Example

var bitflipper = require('pull-bitflipper')

pull(
  //create a source that calls a callback when it gets aborted.
  source(function onAbort(err) {
    //this should be called when the output fails because a bit was filpped.
  }),

  createEncryptStream(),

  //pass in the probability that a particular message should
  //contain a flipped bit.
  bitflipper(prop = 0.1),

  createDecryptStream(),

  sink(function (err) {
    //the sink should error when the decryption stream
    //finds a packet that does not authenticate.
  })
)

License

MIT