You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Runtime-deprecate calling digest() on HMAC more than once #62838
Given the lack of usefulness of the second digest() call's return (and in so the likelyhood of it being depended on), shouldn't we treat this as a bug fix?
Add a test that ensures the second call to .digest() returns an empty
HMAC, like it did before. No comment on whether that is the right
behavior or not.
Enough time to land a
semver-majorPRs that contain breaking changes and should be released in the next major version.
runtime-deprecation for v27.x and then soonest with v28.x EOL the deprecation.
expectWarning is keyed by warning name, so the inline DEP0181 block at the bottom of test-crypto-hmac.js overwrites the new DEP0206 registration. Merging them at the top resolves it.
Activity
panva commentedon Apr 20, 2026
Given the lack of usefulness of the second digest() call's return (and in so the likelyhood of it being depended on), shouldn't we treat this as a bug fix?panva commentedon Apr 20, 2026
The behaviour looks entirely deliberate
node/lib/internal/crypto/hash.js
Lines 185 to 190 in c3dd52a
but looking at the blame its introduction traces back to #15231 by @jasnell, its parent was just throwing the same as
Hashnode/lib/crypto.js
Line 121 in 8fa5fcc
jasnell commentedon Apr 20, 2026
Oh, we reaching way back. I don't remember what the reasoning here was. I'm +1 on deprecation of the inconsistent behavior
panva commentedon Apr 20, 2026
Test Wayback machine: #14122, a3b9f4b
panva commentedon Apr 20, 2026
Yeah, +1 deprecate it.
ChALkeR commentedon Apr 20, 2026
@panva this was also auto-detected by the scanner behind @deepview-autofix btw.
But this in fact looks intentional so I would recommend removing this in a major as a safeguard, following a deprecation cycle.
Upd: github glitched, I replied to #62838 (comment), all the other comments (end the edit on that one) just loaded. I agree with those.
panva commentedon Apr 20, 2026
Enough time to land a semver-majorPRs that contain breaking changes and should be released in the next major version.
runtime-deprecation for v27.x and then soonest with v28.x EOL the deprecation.
mizoz commentedon Apr 28, 2026
Hi! I'd love to contribute. Could you assign this issue to me?
Anshikakalpana commentedon May 4, 2026
Hi! I’d like to work on this issue. I’m preparing a PR for it.
doc: add Hmac.digest() documentation-only deprecation (DEP0206)
soulee-dev commentedon May 13, 2026
@Anshikakalpana Left review suggestions for the CI failure.
expectWarning is keyed by warning name, so the inline
DEP0181block at the bottom of test-crypto-hmac.js overwrites the new DEP0206 registration. Merging them at the top resolves it.#63162 (review)
doc: add Hmac.digest() documentation-only deprecation (DEP0206)
doc: add Hmac.digest() documentation-only deprecation (DEP0206)
doc: add Hmac.digest() documentation-only deprecation (DEP0206)
Aanushka001 commentedon May 24, 2026
Fetching comments for issue #62838...
crypto: runtime-deprecate calling Hmac.digest() more than once
crypto: runtime-deprecate calling Hmac.digest() more than once
doc: add Hmac.digest() documentation-only deprecation (DEP0206)
Merge upstream Node.js v24.18.1 into dotnet/main (#375)