Error: src/app/shared/services/crypto.service.ts:47:59 - error TS2345: Argument of type 'HasherHelper' is not assignable to parameter of type '(str: string) => string'.
Type 'WordArray' is not assignable to type 'string'.
47 const result = this.crypto.verify(payload, signature, CryptoJS.SHA256);
Hello, I'm in the middle of an Angular update version from 9 to 16 and I'm getting this error when I updated crypto-js from 4.0.0 to 4.1.1
The original code was
but It was giving this error
Error: src/app/shared/services/crypto.service.ts:47:59 - error TS2345: Argument of type 'HasherHelper' is not assignable to parameter of type '(str: string) => string'. Type 'WordArray' is not assignable to type 'string'.
47 const result = this.crypto.verify(payload, signature, CryptoJS.SHA256);
Is this enough to replace the code with
or is there a correct and better way? At the moment I cannot create a unit test for this since the solution is not compiling
Any help appreciated, Thanks