I'm going to need this for calculating the sha256 blob hash for Blob service.
As suggested in one of "Cryptography discussion" threads, I exposed the Olm sha256 via JSI.
I was basing on the official Olm unit test example.
Differential D7605
[native] Expose Olm sha256 via JSI bartek on Apr 25 2023, 4:48 AM. Authored by Tags None Referenced Files
Details
I'm going to need this for calculating the sha256 blob hash for Blob service. I was basing on the official Olm unit test example. Called commUtilsModule.sha256() and compared the result with the unit test above: const helloWorldArray = new Uint8Array([0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x2c, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64]); const helloWorldHash = commUtilsModule.sha256(helloWorldArray.buffer); console.log('Actual:\t', helloWorldHash); console.log('Expected:\t', 'A2daxT/5zRU1zMffzfosRYxSGDcfQY3BNvLRmsH76KU'); Results can be validated via: https://emn178.github.io/online-tools/sha256.html - first use SHA256, then Base64 encode
Diff Detail
Event Timeline
|