mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
crypto: runtime deprecate Hash constructor
PR-URL: https://github.com/nodejs/node/pull/51880 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
This commit is contained in:
parent
0b4cdb4b42
commit
de0602d190
@ -3563,12 +3563,15 @@ release lines. Please use [`dirent.parentPath`][] instead.
|
||||
|
||||
<!-- YAML
|
||||
changes:
|
||||
- version: REPLACEME
|
||||
pr-url: https://github.com/nodejs/node/pull/51880
|
||||
description: Runtime deprecation.
|
||||
- version: v21.5.0
|
||||
pr-url: https://github.com/nodejs/node/pull/51077
|
||||
description: Documentation-only deprecation.
|
||||
-->
|
||||
|
||||
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.
|
||||
|
@ -231,7 +231,7 @@ module.exports = {
|
||||
DiffieHellman,
|
||||
DiffieHellmanGroup,
|
||||
ECDH,
|
||||
Hash,
|
||||
Hash: deprecate(Hash, 'crypto.Hash constructor is deprecated.', 'DEP0179'),
|
||||
Hmac,
|
||||
KeyObject,
|
||||
Sign,
|
||||
|
@ -276,3 +276,13 @@ assert.throws(
|
||||
assert.strictEqual(a.digest('hex'), b.digest('hex'));
|
||||
assert.strictEqual(c.digest('hex'), d.digest('hex'));
|
||||
}
|
||||
|
||||
{
|
||||
crypto.Hash('sha256');
|
||||
common.expectWarning({
|
||||
DeprecationWarning: [
|
||||
['crypto.Hash constructor is deprecated.',
|
||||
'DEP0179'],
|
||||
]
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user