Title: Buffer.byteLength benchmark does not test base64 encoding correctly · Issue #60836 · nodejs/node · GitHub
Open Graph Title: Buffer.byteLength benchmark does not test base64 encoding correctly · Issue #60836 · nodejs/node
X Title: Buffer.byteLength benchmark does not test base64 encoding correctly · Issue #60836 · nodejs/node
Description: Version Output of node -v: (e.g. v20.10.0) Platform Output of uname -a (for UNIX) or Windows version string (for Windows). Subsystem buffers (benchmark/buffers/buffer-bytelength-string.js) What steps will reproduce the bug? Run the buffe...
Open Graph Description: Version Output of node -v: (e.g. v20.10.0) Platform Output of uname -a (for UNIX) or Windows version string (for Windows). Subsystem buffers (benchmark/buffers/buffer-bytelength-string.js) What ste...
X Description: Version Output of node -v: (e.g. v20.10.0) Platform Output of uname -a (for UNIX) or Windows version string (for Windows). Subsystem buffers (benchmark/buffers/buffer-bytelength-string.js) What ste...
Opengraph URL: https://github.com/nodejs/node/issues/60836
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Buffer.byteLength benchmark does not test base64 encoding correctly","articleBody":"### Version\n\nOutput of node -v: (e.g. v20.10.0)\n\n### Platform\n\n```text\nOutput of uname -a (for UNIX) or Windows version string (for Windows).\n```\n\n### Subsystem\n\nbuffers (benchmark/buffers/buffer-bytelength-string.js)\n\n### What steps will reproduce the bug?\n\nRun the buffer byteLength benchmark for base64 encoding.\nExpected: getInput should return a base64-encoded string when encoding is 'base64'.\nActual: getInput returns the original string, not the base64-encoded string.\n\n### How often does it reproduce? Is there a required condition?\n\nRun the buffer byteLength benchmark for base64 encoding.\nExpected: getInput should return a base64-encoded string when encoding is 'base64'.\nActual: getInput returns the original string, not the base64-encoded string.\n\n### What is the expected behavior? Why is that the expected behavior?\n\ngetInput should return the base64-encoded string so the benchmark accurately tests Buffer.byteLength for base64 input.\n\n\n\n### What do you see instead?\n\nThe benchmark tests the original string, not the base64-encoded string.\n\n### Additional information\n\nSuggested fix:\nIn benchmark/buffers/buffer-bytelength-string.js, update getInput to return Buffer.from(original, 'utf8').toString('base64') when encoding is 'base64'.\nThis will ensure the benchmark is correct.","author":{"url":"https://github.com/kisugez","@type":"Person","name":"kisugez"},"datePublished":"2025-11-24T10:32:40.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/60836/node/issues/60836"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2a335279-c33a-a194-059c-1d476fc92f87 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A448:2B8AFB:16BCF75:1F51BF1:6A4BFE65 |
| html-safe-nonce | b8e88c8503e0b2d0192f963e1df5eb46b4c029ece50e7d615d3cc6401b2b7b5b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDQ4OjJCOEFGQjoxNkJDRjc1OjFGNTFCRjE6NkE0QkZFNjUiLCJ2aXNpdG9yX2lkIjoiNTE1NDczOTQ1MTczMzk5OTIwNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5c29a82b55dccda380660218d82f424c7ec6ba005cea6a0da5e46d16380bf86b |
| hovercard-subject-tag | issue:3658201434 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/60836/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b42cde54ac732270edec3b09a611d79a5d9a0fce9e9834e37c7e41ee32e7a117/nodejs/node/issues/60836 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b42cde54ac732270edec3b09a611d79a5d9a0fce9e9834e37c7e41ee32e7a117/nodejs/node/issues/60836 |
| og:image:alt | Version Output of node -v: (e.g. v20.10.0) Platform Output of uname -a (for UNIX) or Windows version string (for Windows). Subsystem buffers (benchmark/buffers/buffer-bytelength-string.js) What ste... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kisugez |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0f5d3ba365b3985d75c32a5957c8635488d58dcf027ae6ae958eee7edaa306a2 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6c542436f9c7282f518e9ec7bc5a3adff20a13fd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width