FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

crypto: remove default encoding from Hash/Hmac by tniessen · Pull Request #49167 · nodejs/node · GitHub

/ node Public

crypto: remove default encoding from Hash/Hmac - #49167

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
tniessen:crypto-hash-default-encoding
Aug 16, 2023
Merged

crypto: remove default encoding from Hash/Hmac#49167
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
tniessen:crypto-hash-default-encoding

Conversation

tniessen commented Aug 14, 2023
edited
Loading

Copy link
Copy Markdown
Member

getDefaultEncoding() always returns 'buffer' in Node.js 20. It requires some careful justification but the default encoding can be eliminated from hash.js entirely. The reasoning is almost identical with that in #49145 so I won't repeat it here. The main thing to note here is that digest() conveniently defaults to BUFFER for falsy encodings.

This partially addresses:

// TODO(tniessen): remove all call sites and this function
function getDefaultEncoding() {
return 'buffer';
}

Refs: #47182

getDefaultEncoding() always returns 'buffer' in Node.js 20. It requires
some careful justification but the default encoding can be eliminated
from hash.js entirely. The reasoning is almost identical with that in
nodejs#49145 so I won't repeat it here.

Refs: nodejs#47182

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto

nodejs-github-bot added crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run. labels Aug 14, 2023
tniessen added author ready PRs that have at least one approval, no outstanding review comments, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Aug 14, 2023
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 14, 2023

This comment was marked as outdated.

Copy link
Copy Markdown
Collaborator

tniessen added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 15, 2023
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 16, 2023
nodejs-github-bot merged commit 8ed4397 into nodejs:main Aug 16, 2023

Copy link
Copy Markdown
Collaborator

Landed in 8ed4397

tniessen added a commit to tniessen/node that referenced this pull request Aug 16, 2023
debadree25 pushed a commit that referenced this pull request Aug 19, 2023
Refs: #47182
Refs: #47869
Refs: #47943
Refs: #47998
Refs: #49140
Refs: #49145
Refs: #49167
Refs: #49169
PR-URL: #49170
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
UlisesGascon pushed a commit that referenced this pull request Sep 10, 2023
getDefaultEncoding() always returns 'buffer' in Node.js 20. It requires
some careful justification but the default encoding can be eliminated
from hash.js entirely. The reasoning is almost identical with that in
#49145 so I won't repeat it here.

Refs: #47182
PR-URL: #49167
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
UlisesGascon pushed a commit that referenced this pull request Sep 10, 2023
Refs: #47182
Refs: #47869
Refs: #47943
Refs: #47998
Refs: #49140
Refs: #49145
Refs: #49167
Refs: #49169
PR-URL: #49170
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
UlisesGascon mentioned this pull request Sep 10, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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 outstanding review comments, and a CI started. 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


Back | FazBrowse Home | New Git URL