Can I use sha256 function in Ionic?

If the iOS Safari version is sufficiently old (like <10), its implementation may be wonky. If you are using WkWebview, that may help. You could also look at webcrypto-shim.

1 Like

Thanks much appreciated!

Hi, im trying to use the WebCrypto API but im having a little difficult converting string to ArrayBuffer, do you have any hint on that?

The js-jose library has some utility functions that do that; look for arrayFromString() and stringFromArray().

i used the functions and it works now, but i still have a problem, when i use ā€œionic cordova runā€ command to debug the app, the crypto.subtle object is undefined, when i use ā€œionic cordova buildā€ command, the WebCrypto works fineā€¦ it should be that way?

Gracias, me ayudĆ³ mucho tu cĆ³digo. Solo que en ionic 4 tuve que usar

import * as CryptoJS from 'crypto-js';

Muchas gracias.