Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect hashes when streaming #3

Open
erothmayer opened this issue Jul 18, 2018 · 2 comments
Open

Incorrect hashes when streaming #3

erothmayer opened this issue Jul 18, 2018 · 2 comments

Comments

@erothmayer
Copy link

When using streaming (non-buffered inputs) Spritesmash is computing an identical hash every time, regardless of file contents. I'm running it independently on multiple files, and always get 1441a7909c.

Adding a .pipe(buffer()) before spritesmash gets it to generate what appear to be meaningful hashes, which vary by file contents as far as I can tell.

@foresightyj
Copy link

foresightyj commented Aug 3, 2019

Same problem here, because it actually is hashing the string content [object Object] every time.

    const newName = hashFunc(
        filePath,
        file.isStream() ? file.contents.toString() : file.contents
      );
      console.log('hashing', file.contents.toString(), 'to', newName);

[16:04:08] Using gulpfile D:\Working\FHT.Web\gulpfile.js
[16:04:08] Starting 'sprite'...
hashing [object Object] to sprite-1441a7909c.png
[16:04:09] Finished 'sprite' after 1.2 s

@brunis
Copy link

brunis commented Apr 28, 2020

When using streaming (non-buffered inputs) Spritesmash is computing an identical hash every time, regardless of file contents. I'm running it independently on multiple files, and always get 1441a7909c.

Adding a .pipe(buffer()) before spritesmash gets it to generate what appear to be meaningful hashes, which vary by file contents as far as I can tell.

i noticed the example was actually requiring gulp-buffer, but forgot to use it..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants