livechat / accounts-sdk

SDK for 'Sign in with LiveChat'.
https://developers.livechat.com/building-apps-crash-course/livechat-apis/
MIT License
2 stars 3 forks source link

Drop SJCL in favor of Web Crypto API #8

Closed dmgawel closed 2 years ago

dmgawel commented 2 years ago

This is an attempt of switching to Web Crypto API for sha256 hashing. This will allow to drop sjcl dependency (which is great, but created before native APIs were available).

The only problem for now is that Web Crypto API is asynchronous (while sjcl is sync), so this will probably reflect higher up in all functions.

Todo:

dmgawel commented 2 years ago

Unfortunately Accounts relies on internal sjcl representation of hashed reults, which is array of big indian integers, instead of standard hex representation. Because of that I dropped the initial idea of switching to Web Crypto API. New attempt will be continued in #10.