Skip to content

Stream for encoding #18

@arestov

Description

@arestov

Currently we can stream file and decoding it.
Is is possible to implement encoding stream?

I want to do this

var cryptoStream = crypto.createHash('sha1');
cryptoStream.on('end', function(){
    console.log(cryptoStream.digest('hex'));
});

var bencStream = new benc.EncodeStream({prop: []});
bencStream.on('data', function(chunk){
    cryptoStream.update(chunk);
});
bencStream.on('end', function(){
    cryptoStream.update(null);
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions