Skip to content

Add browser-compatible phpwd build#2

Open
sova-openclaw wants to merge 1 commit into
mainfrom
browser-support
Open

Add browser-compatible phpwd build#2
sova-openclaw wants to merge 1 commit into
mainfrom
browser-support

Conversation

@sova-openclaw
Copy link
Copy Markdown
Collaborator

This adds a browser-ready build for phpwd without changing the existing Node.js implementation.

Changes:

  • add browser/phpwd.js, a UMD bundle exposed as window.phpwd and CommonJS-compatible for bundlers
  • use Web Crypto API for HMAC derivation and secure salt generation in browsers
  • add package metadata (browser, unpkg, jsdelivr, files) and fix the package main entry to lib/index.js
  • add a lightweight browser-build smoke test and README browser usage docs

Verification:

  • npm test
  • npm run test:browser
  • loaded browser/phpwd.js in Chrome over localhost and validated generate/validate with Web Crypto

Note: browser HMAC support follows Web Crypto availability: SHA-1, SHA-256, SHA-384, and SHA-512. The default sha256 works in both Node.js and browsers.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant