0.1.1 • Published 5 years ago

pull-bitflipper v0.1.1

Weekly downloads
51
License
MIT
Repository
github
Last release
5 years ago

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

0.1.1

5 years ago

0.1.0

9 years ago

0.0.1

9 years ago

0.0.0

9 years ago