Giter Site home page Giter Site logo

Comments (13)

silverbucket avatar silverbucket commented on May 30, 2024

And just to cover my bases. I also tried this with a for loop, instead of a forEach on the off chance that somehow the items were not being appended in order:

for (var i = 0, len = collectedArray.length; i < len; i += 1) {
  spark.append(collectedArray[i]);
}

from js-spark-md5.

satazor avatar satazor commented on May 30, 2024

I can't see anything wrong from the usage perspective. Can you create a small reproducible fiddle so I can play around and identify the issue? A zip file would also sufice.

from js-spark-md5.

silverbucket avatar silverbucket commented on May 30, 2024

Hi @satazor, I created a small demo that performs the following steps:

  • downloads an image
  • slices it up
  • stores it
  • displays it
    ...
  • loads it
  • displays a second one (from the idb data)
  • runs append on the array of elements (attached md5 to html)
  • merges arrays of arraybuffers into one
  • displays the md5 for that

You can check it out, run a local http server in the directory, and view the index.html. Be sure to open the console as a lot info is contained there.

As you'll see the original md5 is displayed first (static), then the one from the series of appends (incorrect) then another from a merged arraybuffer (correct).

I tried to keep it very simple, give it a shot and let me know what you think.
https://github.com/silverbucket/md5example

from js-spark-md5.

satazor avatar satazor commented on May 30, 2024

Thanks @silverbucket will look at it later today, after work.

from js-spark-md5.

satazor avatar satazor commented on May 30, 2024

There was a bug indeed in the SparkMD5.ArrayBuffer but that was fixed in 9f54482. Your example is using an outdated version of SparkMD5. I've tested your example with 2.0.0 and 1.0.1 versions and it works correctly!

from js-spark-md5.

satazor avatar satazor commented on May 30, 2024

screen shot 2015-11-02 at 12 27 55

from js-spark-md5.

silverbucket avatar silverbucket commented on May 30, 2024

Oh, I missed that update. Since I use node as my build environment (with
browserify) I cannot simply include a file from the SparkMD5 repository, I
must manually copy it into the project whenever I see an update.

Any chance for adding a build step which creates a file that uses the node
module system of module.exports ? I know it's not meant to run in node, but
taking into account the npm+node build environment, it still has a lot of
benefits.

On Mon, Nov 2, 2015 at 1:29 PM André Cruz [email protected] wrote:

[image: screen shot 2015-11-02 at 12 27 55]
https://cloud.githubusercontent.com/assets/1017236/10881728/4a9b00cc-815d-11e5-89cd-0e17435b7be6.png


Reply to this email directly or view it on GitHub
#31 (comment).

from js-spark-md5.

silverbucket avatar silverbucket commented on May 30, 2024

ie. so that there's a third file: node-sparkmd5.js or something?

from js-spark-md5.

silverbucket avatar silverbucket commented on May 30, 2024

Are you sure you published the latest version(s) of SparkMD5 to npm? I'm still getting v1.0.0

from js-spark-md5.

satazor avatar satazor commented on May 30, 2024

Sorry, it should be published now. Totally forgot.

from js-spark-md5.

satazor avatar satazor commented on May 30, 2024

Regarding the npm/node usage, it should work out of the box, see: https://github.com/satazor/SparkMD5/blob/master/spark-md5.js#L4 and https://github.com/satazor/SparkMD5/blob/master/package.json#L5

from js-spark-md5.

silverbucket avatar silverbucket commented on May 30, 2024

Ah, right, not sure why I decided that wouldn't work before. Works fine for me now :)
Thanks!

from js-spark-md5.

db2190 avatar db2190 commented on May 30, 2024

I want to upload a file of 1GB with chunk size of 1MB each and i wish to calculate and validate each chunk with checksum on server, can someone point me in correct direction?

from js-spark-md5.

Related Issues (20)

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.