Coder Social home page Coder Social logo

Comments (7)

GoogleCodeExporter avatar GoogleCodeExporter commented on May 24, 2024
It's interesting idea. The upcoming 3.0 release will indeed support 
incrementally appending the message. Though, it'll be tricky to continue 
appending after you've completed the digest. Completing the digest involves 
adding padding, then hashing the last padded block.

Original comment by Jeff.Mott.OR on 26 Jan 2012 at 7:23

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

from crypto-js.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 24, 2024
Cool.  It seems doable if you just make the final padding and hashing 
calculation local to the function that returns the digest instead of mutating 
the object (you could cache the digest if you were worried about the efficiency 
of repeated calls to digest()).

Is the code for your upcoming 3.0 release currently available in a public 
repository?  If so I'd be happy to take a stab at it and send a patch, if you 
like.

Original comment by [email protected] on 26 Jan 2012 at 8:00

from crypto-js.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 24, 2024
http://code.google.com/p/crypto-js/source/browse/branches/#branches%2F3.x%2Fsrc

Original comment by Jeff.Mott.OR on 26 Jan 2012 at 8:08

from crypto-js.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 24, 2024
I also have the need to compute MD5 checksums incrementally. This, combined 
with the new HTML5 File APIs would allow for a very robust upload mechanism. 
Any estimate on when this functionality (supposedly in version 3) will be 
available?

Thanks!
Evan

Original comment by [email protected] on 16 Mar 2012 at 9:23

from crypto-js.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 24, 2024
Version 3 is very close. I'd expect it to be ready within the next month. I'm 
mostly focusing on the cipher components now, and the hashing components are 
largely set.

Here's a preview for you.


<!doctype html>

<script 
src="http://crypto-js.googlecode.com/svn-history/r437/branches/3.x/src/core.js">
</script>
<script 
src="http://crypto-js.googlecode.com/svn-history/r437/branches/3.x/src/sha256.js
"></script>
<script 
src="http://crypto-js.googlecode.com/svn-history/r437/branches/3.x/src/enc-base6
4.js"></script>

<script>

// Basic hashing
var hash = CryptoJS.SHA256('abc');

// Output encoding
alert('Hash encoded as latin-1 string: ' + hash.toString(CryptoJS.enc.Latin1));
alert('Hash encoded as base-64 string: ' + hash.toString(CryptoJS.enc.Base64));
alert('Hash encoded as hex string: ' + hash); // Default is hex

// Incremental hashing
var sha256 = CryptoJS.algo.SHA256.create();
sha256.update('a');
sha256.update('b');
sha256.update('c');
var hash = sha256.finalize();

alert('Incrementally computed hash: ' + hash);

// Incremental hashing, capturing intermediate hash values
var sha256 = CryptoJS.algo.SHA256.create();
var hashA = sha256.update('a').clone().finalize();
var hashAB = sha256.update('b').clone().finalize();
var hashABC = sha256.update('c').clone().finalize();

alert('Intermediate hash value "a": ' + hashA);
alert('Intermediate hash value "ab": ' + hashAB);
alert('Intermediate hash value "abc": ' + hashABC);

</script>

Original comment by Jeff.Mott.OR on 16 Mar 2012 at 10:27

from crypto-js.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 24, 2024
This feature now officially available with version 3.

Original comment by Jeff.Mott.OR on 6 May 2012 at 7:51

  • Changed state: Fixed

from crypto-js.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 24, 2024
Great! Thanks for the excellent work, Jeff.

Original comment by [email protected] on 7 May 2012 at 7:50

from crypto-js.

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.