I install module:
npm install --save crypto
I import it to my component:
import { createHmac } from \"crypto\";
I am developing with the latest versions of Angular and 'crypto-js' seems to work fine.
Install the package and the definitions:
npm install crypto-js
npm install --save @types/crypto-js
Use it:
import { SHA256, enc } from "crypto-js";
...
login() {
...
const hashedPass = SHA256(this.loginForm.value.password).toString(enc.Hex);
...
}