Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > pl.comp.lang.javascript > #3489

Re: Hashing library

From Borys Pogoreło <borys@pl.edu.leszno>
Newsgroups pl.comp.lang.javascript
Subject Re: Hashing library
Date 2018-08-10 11:49 +0200
Organization snafu
Message-ID <9a4dym4anctr$.1fkr0tr1ah1te$.dlg@40tude.net> (permalink)
References (2 earlier) <1xbx91tfkrzcf.dlg@tyczka.com> <1291u9tu6p6uq.1ihbayc0y8bmw.dlg@40tude.net> <k8rs0fgtbu7s$.dlg@tyczka.com> <1uv4sltabhocn$.rl6dp2a8um20$.dlg@40tude.net> <13nchrdxh4skw.dlg@tyczka.com>

Show all headers | View raw


Dnia Thu, 9 Aug 2018 11:04:50 +0200, Roman Tyczka napisał(a):

> let result = sha512('raz dwa trzy');
> 
> tutaj result ciągle jest niepoliczony, ma obiekt typu Promise ze stanem
> Pending :-(

Bo teraz wymieszałeś async i then(). Jeśli korzystasz z async, to życie
staje się dużo prostsze, bo piszesz sekwencyjnie:

var buff = await window.crypto.subtle.digest("SHA-512", buffer);
var bytes = new Uint8Array(buff);
... itd.

Trzeba zadbać tylko o jakąś obsługę wyjątków.

> Tylko to niestety jest dla mnie nie do ogarnięcia, z przerwami tkwie już w
> tym 3ci dzie i nie potrafię tego ogarnąć, mój stary mózg jest chyba zbyt
> sztywny na te wielokrotnie zagłębione anonymousy.

Ogarniesz. Trzeba po prostu zmienić sposób myślenia.

-- 
Borys Pogoreło
borys(#)leszno,edu,pl

Back to pl.comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Hashing library Roman Tyczka <noemail@because.no> - 2018-08-03 14:32 +0200
  Re: Hashing library Borys Pogoreło <borys@pl.edu.leszno> - 2018-08-03 15:33 +0200
    Re: Hashing library Roman Tyczka <noemail@because.no> - 2018-08-03 15:45 +0200
      Re: Hashing library Roman Tyczka <noemail@because.no> - 2018-08-03 16:15 +0200
      Re: Hashing library Borys Pogoreło <borys@pl.edu.leszno> - 2018-08-03 19:57 +0200
        Re: Hashing library Roman Tyczka <noemail@because.no> - 2018-08-06 14:41 +0200
          Re: Hashing library Roman Tyczka <noemail@because.no> - 2018-08-06 22:23 +0200
          Re: Hashing library Borys Pogoreło <borys@pl.edu.leszno> - 2018-08-08 22:34 +0200
            Re: Hashing library Roman Tyczka <noemail@because.no> - 2018-08-09 11:04 +0200
              Re: Hashing library Borys Pogoreło <borys@pl.edu.leszno> - 2018-08-10 11:49 +0200
                Re: Hashing library Roman Tyczka <noemail@because.no> - 2018-08-10 12:41 +0200
                Re: Hashing library Borys Pogoreło <borys@pl.edu.leszno> - 2018-08-10 20:03 +0200
        Re: Hashing library Roman Tyczka <noemail@because.no> - 2018-08-10 12:47 +0200
          Re: Hashing library Borys Pogoreło <borys@pl.edu.leszno> - 2018-08-10 22:34 +0200
            Re: Hashing library Roman Tyczka <noemail@because.no> - 2018-08-13 12:02 +0200
              Re: Hashing library Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2018-08-13 14:46 +0200
              Re: Hashing library Borys Pogoreło <borys@pl.edu.leszno> - 2018-08-19 21:40 +0200
                Re: Hashing library Roman Tyczka <noemail@because.no> - 2018-09-04 09:30 +0200
                Re: Hashing library Tomek <skowtom@wp.xxx.pl> - 2018-09-04 09:45 +0200
                Re: Hashing library Roman Tyczka <noemail@because.no> - 2018-09-04 10:59 +0200
                Re: Hashing library Wojciech Bancer <wojciech.bancer@gmail.com> - 2018-09-04 14:30 +0200
                Re: Hashing library Roman Tyczka <noemail@because.no> - 2018-09-04 15:17 +0200
                Re: Hashing library Wojciech Bancer <wojciech.bancer@gmail.com> - 2018-09-04 15:55 +0200
                Re: Hashing library Wojciech Bancer <wojciech.bancer@gmail.com> - 2018-09-04 16:41 +0200
                Re: Hashing library Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2018-09-04 19:05 +0200
                Re: Hashing library Borys Pogoreło <borys@pl.edu.leszno> - 2018-09-06 22:46 +0200
                Re: Hashing library Wojciech Bancer <wojciech.bancer@gmail.com> - 2018-09-06 23:13 +0200
                Re: Hashing library Borys Pogoreło <borys@pl.edu.leszno> - 2018-09-07 13:07 +0200
                Re: Hashing library Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2018-09-04 19:03 +0200
                Re: Hashing library Borys Pogoreło <borys@pl.edu.leszno> - 2018-09-06 22:58 +0200

csiph-web