W3C home > Mailing lists > Public > public-webcrypto@w3.org > April 2013

Re: Updated spec examples with Futures

From: Aymeric Vitte <vitteaymeric@gmail.com>
Date: Thu, 25 Apr 2013 16:18:39 +0200
Message-ID: <51793B3F.2060408@gmail.com>
To: Alex Russell <slightlyoff@google.com>
CC: "public-webcrypto@w3.org" <public-webcrypto@w3.org>, Ryan Sleevi <rsleevi@chromium.org>
Looks nicer than the on_event things.

".done(console.log.bind(console, "The signature is: 
"),console.error.bind(console, "Unable to sign"));"

Not sure everybody is familiar with bind(this,args)...

If I want to use Future result, I suppose :

.done(function() {console.log(this.result)})

or (direct result as the last example)

.done(function(result) {console.log(result)})

Can I do :

var h=window.crypto.digest("sha1");
var res1=h.process(stream1);
res1.finish().done(
     function() {
         console.log(this.result); //result 1
     }
);
var res2=res1.process(stream2);
res2.finish().done(
     function() {
         console.log(this.result); //result 1+2
     }
);

Regards,

Le 25/04/2013 11:51, Alex Russell a écrit :
> As per yesterday's discussion, I've updated the github repo with 
> re-worked examples:
>
> https://github.com/slightlyoff/DOMFuture/commit/614dcbb347962092a2b55a85980c9cc9732175f1
>
> Regards

-- 
jCore
Email :  avitte@jcore.fr
iAnonym : http://www.ianonym.com
node-Tor : https://www.github.com/Ayms/node-Tor
GitHub : https://www.github.com/Ayms
Web :    www.jcore.fr
Webble : www.webble.it
Extract Widget Mobile : www.extractwidget.com
BlimpMe! : www.blimpme.com
Received on Thursday, 25 April 2013 14:16:19 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:17:16 UTC