abstract base class for crypto-streams
Switch branches/tags
Clone or download
Latest commit bc18dc8 Jul 6, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.eslintrc first Sep 26, 2015
.gitignore rename README to README, add .gitignore May 24, 2017
.travis.yml travis Sep 27, 2015
LICENSE add MIT LICENSE May 24, 2017
README.md rename README to README, add .gitignore May 24, 2017
index.js index: add missing Buffer.alloc Jul 6, 2017
package.json 1.0.4 Jul 6, 2017
test.js use safe-buffer May 24, 2017

README.md

cipher-base

Build Status

Abstract base class to inherit from if you want to create streams implementing the same api as node crypto streams.

Requires you to implement 2 methods _final and _update. _update takes a buffer and should return a buffer, _final takes no arguments and should return a buffer.

The constructor takes one argument and that is a string which if present switches it into hash mode, i.e. the object you get from crypto.createHash or crypto.createSign, this switches the name of the final method to be the string you passed instead of final and returns this from update.