Skip to content

Conversation

@ElijahKotyluk
Copy link
Collaborator

@ElijahKotyluk ElijahKotyluk commented Nov 24, 2025

Draft Powered by Pull Request Badge

Summary

Implements Node.js Hash.

  • createHash method
  • NodeHash class
  • NodeHash.update() method
  • NodeHash.clone() method
  • NodeHash.digest() method

Changelog

  • feat(cli): added a thing
  • fix(dev): fixed a thing
  • chore: updated → 1.0

@codecov
Copy link

codecov bot commented Nov 24, 2025

Codecov Report

❌ Patch coverage is 63.93443% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.67%. Comparing base (d6e5b1c) to head (16ded3c).

Files with missing lines Patch % Lines
...kotlin/elide/runtime/node/crypto/NodeCryptoHash.kt 63.63% 15 Missing and 5 partials ⚠️
...ain/kotlin/elide/runtime/node/crypto/NodeCrypto.kt 66.66% 0 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1779      +/-   ##
==========================================
+ Coverage   42.64%   42.67%   +0.03%     
==========================================
  Files         897      898       +1     
  Lines       38473    38534      +61     
  Branches     5989     6005      +16     
==========================================
+ Hits        16405    16444      +39     
- Misses      19845    19860      +15     
- Partials     2223     2230       +7     
Flag Coverage Δ
jvm 42.67% <63.93%> (+0.03%) ⬆️
lib 42.67% <63.93%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...tlin/elide/runtime/intrinsics/js/node/CryptoAPI.kt 0.00% <ø> (ø)
...ain/kotlin/elide/runtime/node/crypto/NodeCrypto.kt 86.36% <66.66%> (-1.14%) ⬇️
...kotlin/elide/runtime/node/crypto/NodeCryptoHash.kt 63.63% <63.63%> (ø)

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d6e5b1c...16ded3c. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ElijahKotyluk ElijahKotyluk self-assigned this Nov 24, 2025
@ElijahKotyluk ElijahKotyluk added 🚧 WIP Works-in-progress. Blocks merge api:node Node API and stdlib feature Large PRs or issues with full-blown features lang:javascript Issues relating to JavaScript labels Nov 24, 2025
@ElijahKotyluk ElijahKotyluk changed the title feat(createHash): initial implementation and tests. feat(node): crypto.createHash Nov 24, 2025
@ElijahKotyluk ElijahKotyluk force-pushed the feat/crypto-hash branch 3 times, most recently from c556a88 to 5aeee8c Compare November 26, 2025 02:41
- Allow digest() to be invoked with zero arguments from JS (fixes arity mismatch error)
- Default to returning a ByteArray when no encoding is provided
- Normalize encoding values and ensure lowercase comparisons
- Aligns NodeHash behavior with Node.js crypto.Hash

This fixes guest tests that are calling `hash.digest()` without arguments.

Signed-off-by: Elijah Kotyluk <[email protected]>
…is passed.

- Expand test coverage on digest method
- Validate string check with Value type argument is working as expected in both host and guest

Signed-off-by: Elijah Kotyluk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api:node Node API and stdlib feature Large PRs or issues with full-blown features lang:javascript Issues relating to JavaScript 🚧 WIP Works-in-progress. Blocks merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants