Ionic 2 to generate sha512 code

Hi,

How to generate sha512 code in ionic 2.

Thanks.

I would use WebCrypto:

let data: Uint8Array = [whatever];
crypto.subtle.digest({name: "SHA-512"}, data).then((hash) => {
  hash is an ArrayBuffer of the SHA-512 digest
});

Worked with iOS, but I got “Cannot read property ‘digest’ of undefined” on Android.

any idea?

Perhaps if Android stock webview is really old on that device, it might not have subtlecrypto. You could try using the wkwebviewengine plugin.