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


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

Re: Hashing library

From Roman Tyczka <noemail@because.no>
Newsgroups pl.comp.lang.javascript
Subject Re: Hashing library
Date 2018-08-10 12:41 +0200
Organization ATMAN - ATM S.A.
Message-ID <e6wnc4tdn570.dlg@tyczka.com> (permalink)
References (3 earlier) <1291u9tu6p6uq.1ihbayc0y8bmw.dlg@40tude.net> <k8rs0fgtbu7s$.dlg@tyczka.com> <1uv4sltabhocn$.rl6dp2a8um20$.dlg@40tude.net> <13nchrdxh4skw.dlg@tyczka.com> <9a4dym4anctr$.1fkr0tr1ah1te$.dlg@40tude.net>

Show all headers | View raw


On Fri, 10 Aug 2018 11:49:53 +0200, Borys Pogoreło wrote:

>> 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.

Sprawdzę to potem jeszcze raz, bo to naprawdę ułatwia, choć już z Promisami
troszkę poszedłem do przodu i nawet działa. 
Ale jeśli chodzi o async/await to wg dokumentacji IE tego nie wspiera,
czyli klops :/
Co prawda M$ się już wypiął na IE ale chyba nadal sporo ludzi go używa,
jakie masz na ten temat zdanie?
 
>> 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.

O tak, mózg zapiekły na klasycznym, ładnym, obiektowym i sekwencyjnym
kodzie (mimo częstego i szerokiego korzystania z wątków) ma spory problem,
żeby tę magię przytulić i się pogodzić z tym jak to działa. Co krok to
niespodzianka :-)

-- 
pozdrawiam
Roman Tyczka

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