From 2a63dcaad7bd1b6db3fff1c4dc9246dd1ce0b35d Mon Sep 17 00:00:00 2001 From: marco-ippolito Date: Mon, 26 Feb 2024 12:03:01 +0100 Subject: [PATCH] crypto, doc: runtime deprecate Hash constructor --- doc/api/deprecations.md | 6 +++++- lib/crypto.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index ef54e200f814ad..5ccd67018b230a 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -3562,13 +3562,17 @@ release lines. Please use [`dirent.parentPath`][] instead. ### DEP0179: `Hash` constructor -Type: Documentation-only +Type: Runtime Calling `Hash` class directly with `Hash()` or `new Hash()` is deprecated due to being internals, not intended for public use. diff --git a/lib/crypto.js b/lib/crypto.js index ab9b9d99e11b8b..55a461a638be64 100644 --- a/lib/crypto.js +++ b/lib/crypto.js @@ -229,7 +229,7 @@ module.exports = { DiffieHellman, DiffieHellmanGroup, ECDH, - Hash, + Hash: deprecate(Hash, 'crypto.Hash constructor is deprecated.', 'DEP0179'), Hmac, KeyObject, Sign,