Giter VIP home page Giter VIP logo

base64-stream's People

Contributors

12mix avatar caub avatar congelli501 avatar evocateur avatar rossj avatar trysound avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

base64-stream's Issues

zip file encoded to base64 in stream cannot be read

Hello,

thanks for the great library. We'd like to create a memory-friendly base64 encoder on top of it while working with bigger files. Although, it seems like a zip file encoded to base64 in stream cannot be properly decoded from an in-memory buffer and is corrupted. Please check https://github.com/appium/appium-support/pull/163/files#diff-76980d83b95b157bd0dc770da7793208R136 for the actual implementation and https://github.com/appium/appium-support/pull/163/files#diff-61daa1216539229f5c27de85022654dbR113 is the test for it.

New line or not? file encoding

I'm trying to encrypt a file into aes-256-cbc and then make a base64 to have readable chars.

This is my code:

var fs = require('fs')
var crypto = require('crypto')
var base64 = require('base64-stream')

var algorithm = 'aes-256-cbc'
var password = 'ciao'
var encrypt = crypto.createCipher(algorithm, password)

var r = fs.createReadStream('hello.txt')

r.pipe(encrypt)
 .pipe(base64.encode())
 .pipe(fs.createWriteStream('out.enc'))

That basically returns a file with a content like:

5XhSTuk5/6DilIzIVQqy6/TORf+zvTNrYShuPERTuCs9NYP8eIFq7OpNPSCTNw+2xb2q8a1msg8inHkvYwFRBFqSO+LSeArun2y01iAznaMD61FsqeF4m+0a9mzb8zoXmm25zeDz9Q/WGhhuRs/TuBWHauJdcOiqzbJdBSgwMbv7NWFhhosgPODvauejYkIHo5ZtHOswtFhm8rrKpO7AyQ==

The right output in my case, should behave like the unix base64 bin that actually puts some new line every 76 chars:

5XhSTuk5/6DilIzIVQqy6/TORf+zvTNrYShuPERTuCs9NYP8eIFq7OpNPSCTNw+2xb2q8a1msg8i
nHkvYwFRBFqSO+LSeArun2y01iAznaMD61FsqeF4m+0a9mzb8zoXmm25zeDz9Q/WGhhuRs/TuBWH
auJdcOiqzbJdBSgwMbv7NWFhhosgPODvauejYkIHo5ZtHOswtFhm8rrKpO7AyQ==

Just to be able to decrypt it with:

openssl aes-256-cbc -d -a -nosalt -in out.enc -out out.txt -k ciao

Any hints?

Release latest changes

Thank you for the great package!

The problem: I've read the docs, downloaded the package via npm and started using it just to get an error about Base64Encode not being a constructor. Digging into the source and commit log for this package, I've found out that the interface has changed and the docs in the readme describe the unreleased interface. Looking up the version in the package.json didn't even help because it is the same as on npm (what I usually do first, before looking into commit logs).

Would you mind to release the new package version, possibly as a new major version? Or at least change the version in the package.json to make clear that the version in master branch is a different one from that on npm.

Base64-stream cannot modify headers after they are sent

       req.get("http://maps.googleapis.com/maps/api/streetview?size=300x300&location="+request.body.Destination.coordinates[0]+","+request.body.Destination.coordinates[1])
   .pipe(base64.encode()).pipe(response);

This code looks like causing this exception

An unhandled exception occurred. Error: Can't set headers after they are sent.

It works removing the middle pipe command and streaming direct response.

Version 0.1.4 contains breaking changes

In version 0.1.3, a call like this worked:

const base64Stream = require('base64-stream');
const stream = base64Stream.decode();

Now with version 0.1.4 you need to write it like this:

const {Base64Decode} = require('base64-stream');
const stream = new Base64Decode();

The original way to create a stream does not work anymore which makes this a breaking change because other packages need to adapt their code in order to work with this version.
But NPM just treats this as a bugfix release and just goes for the new version instead of the one specified in the package.json.

In my case i am using pageres-cli which depends on screenshot-stream which is now broken.

So i would like to ask you to unpublish the version and re-release it as a version 1.X or so to make sure
NPM sees it as a new version with breaking changes and does not simply install it like it does now.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.