Socket
Book a DemoInstallSign in
Socket

pull-bitflipper

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pull-bitflipper

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

latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
24
700%
Maintainers
1
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 29 May 2019

Did you know?

Socket

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.

Install

Related posts