Skip to content

test,doc: cover and document multi-byte offset/size in randomFill - #64834

Open
kyungrae2002 wants to merge 3 commits into
nodejs:mainfrom
kyungrae2002:my-branch
Open

test,doc: cover and document multi-byte offset/size in randomFill#64834
kyungrae2002 wants to merge 3 commits into
nodejs:mainfrom
kyungrae2002:my-branch

Conversation

@kyungrae2002

@kyungrae2002 kyungrae2002 commented Jul 30, 2026

Copy link
Copy Markdown
  • Document that offset/size are in elements for a TypedArray and in
    bytes for an ArrayBuffer / DataView (default given per type)
  • Fix randomFill() throwing for ArrayBuffer / DataView with an offset,
    where buf.length - offset becomes NaN
  • Add regression tests for multi-byte offset/size and the offset case

Signed-off-by: kyungrae <kyungrae2002@gmail.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Jul 30, 2026
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.17%. Comparing base (ed63b19) to head (fe7d6b1).
⚠️ Report is 215 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #64834      +/-   ##
==========================================
- Coverage   92.01%   90.17%   -1.85%     
==========================================
  Files         381      746     +365     
  Lines      170167   242763   +72596     
  Branches    26075    45762   +19687     
==========================================
+ Hits       156585   218906   +62321     
- Misses      13291    15325    +2034     
- Partials      291     8532    +8241     
Files with missing lines Coverage Δ
lib/internal/crypto/random.js 96.09% <100.00%> (ø)

... and 533 files with indirect coverage changes

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

Signed-off-by: kyungrae <kyungrae2002@gmail.com>
Signed-off-by: kyungrae <kyungrae2002@gmail.com>
@daeyeon daeyeon added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Aug 2, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 2, 2026
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@daeyeon daeyeon added the crypto Issues and PRs related to the crypto subsystem. label Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants