maidsafe-archive / safe_examples

examples showcasing various features of the SAFE Network
BSD 3-Clause "New" or "Revised" License
82 stars 50 forks source link

sha3Hash example in web_api_playground , async #340

Closed wrnice closed 6 years ago

wrnice commented 6 years ago

The example in the web_api_playground ( not sure the version... , it is live on codeplay.discover ) for sha3Hash tries to : async () => { try { hashedString = await window.safeCrypto.sha3Hash(appHandle, '1010101010101'); } catch (err) { return err; } returnSHA3 Hash generated: ${String.fromCharCode.apply(null, new Uint8Array(res))}; }

This prints ... nothing...

Here, 'res' looks like a remnant of the previous version that used .then ,

maybe it should be : returnSHA3 Hash generated: ${String.fromCharCode.apply(null, new Uint8Array(hashedString))};

?

hunterlester commented 6 years ago

Ah, yes, thank you!