Skip to content

Commit 2ef3f25

Browse files
crypto, doc: runtime deprecate Hash constructor
1 parent fc0f2cf commit 2ef3f25

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

doc/api/deprecations.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3563,12 +3563,15 @@ release lines. Please use [`dirent.parentPath`][] instead.
35633563

35643564
<!-- YAML
35653565
changes:
3566+
- version: REPLACEME
3567+
pr-url: https://github.com/nodejs/node/pull/51880
3568+
description: Runtime deprecation.
35663569
- version: v21.5.0
35673570
pr-url: https://github.com/nodejs/node/pull/51077
35683571
description: Documentation-only deprecation.
35693572
-->
35703573

3571-
Type: Documentation-only
3574+
Type: Runtime
35723575

35733576
Calling `Hash` class directly with `Hash()` or `new Hash()` is
35743577
deprecated due to being internals, not intended for public use.

lib/crypto.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ module.exports = {
229229
DiffieHellman,
230230
DiffieHellmanGroup,
231231
ECDH,
232-
Hash,
232+
Hash: deprecate(Hash, 'crypto.Hash constructor is deprecated.', 'DEP0179'),
233233
Hmac,
234234
KeyObject,
235235
Sign,

0 commit comments

Comments
 (0)