Skip to content
This repository was archived by the owner on Jun 16, 2026. It is now read-only.

fix(storageKeyManager): replace CryptoJS with native synchronous SHA-256 implementation#9215

Open
tmdeveloper007 wants to merge 1 commit into
SandeepVashishtha:masterfrom
tmdeveloper007:9209-cryptojs-replacement
Open

fix(storageKeyManager): replace CryptoJS with native synchronous SHA-256 implementation#9215
tmdeveloper007 wants to merge 1 commit into
SandeepVashishtha:masterfrom
tmdeveloper007:9209-cryptojs-replacement

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

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

  • Remove import CryptoJS from 'crypto-js'
  • Implement sha256Sync() using bitwise SHA-256 operations (same output as CryptoJS.SHA256)

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.

…256 implementation

Remove the CryptoJS import and implement a minimal synchronous SHA-256
using bitwise operations (matching CryptoJS.SHA256 output format).

Closes SandeepVashishtha#9209.
@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

@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.

@github-actions github-actions Bot added the bug Something isn't working label Jun 15, 2026
@tmdeveloper007

Copy link
Copy Markdown
Contributor Author

@SandeepVashishtha Ready for review — PR #9215: Replace CryptoJS with native SHA-256 in storageKeyManager

@codescene-access codescene-access Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

See analysis details in CodeScene

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";
/**

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ New issue: Overall Code Complexity
This module has a mean cyclomatic complexity of 4.14 across 7 functions. The mean complexity threshold is 4

Suppress

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working gssoc:approved gssoc approved PR level:intermediate 35pts quality:clean 1.2x size/M Medium pull request type:bug type:feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(src/utils/storageKeyManager.js): replace CryptoJS with native Web Crypto API

1 participant