fix(storageKeyManager): replace CryptoJS with native synchronous SHA-256 implementation#9215
Conversation
…256 implementation Remove the CryptoJS import and implement a minimal synchronous SHA-256 using bitwise operations (matching CryptoJS.SHA256 output format). Closes SandeepVashishtha#9209.
|
@tmdeveloper007 is attempting to deploy a commit to the sandeepvashishtha's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@SandeepVashishtha Ready for review — PR #9215: Replace CryptoJS with native SHA-256 in storageKeyManager |
There was a problem hiding this comment.
Gates Failed
Enforce advisory code health rules
(1 file with Overall Code Complexity)
Our agent can fix these. Install it.
Gates Passed
3 Quality Gates Passed
Reason for failure
| Enforce advisory code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| storageKeyManager.js | 1 advisory rule | 9.69 → 9.10 | Suppress |
Quality Gate Profile: Clean Code Collective
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
| @@ -1,4 +1,98 @@ | |||
| import CryptoJS from "crypto-js"; | |||
| /** | |||
There was a problem hiding this comment.
❌ New issue: Overall Code Complexity
This module has a mean cyclomatic complexity of 4.14 across 7 functions. The mean complexity threshold is 4
Summary
Replace the CryptoJS import and CryptoJS.SHA256 call in src/utils/storageKeyManager.js with a minimal synchronous SHA-256 implementation using bitwise operations. CryptoJS is a large Node.js crypto library that depends on Node's crypto module internally.
Changes
Impact
Reduces bundle size by removing the CryptoJS dependency. Uses native JavaScript operations available in all modern browsers without external dependencies. Improves SSR compatibility.
Closes #9209.