![github-actions[bot]](/assets/img/avatar_default.png)
You can preview this rule [here](https://sonarsource.github.io/rspec/#/rspec/S4790/go) (updated a few minutes after each push). ## Review A dedicated reviewer checked the rule description successfully for: - [x] logical errors and incorrect information - [x] information gaps and missing content - [x] text style and tone - [x] PR summary and labels follow [the guidelines](https://github.com/SonarSource/rspec/#to-modify-an-existing-rule)
21 lines
667 B
Plaintext
21 lines
667 B
Plaintext
=== Highlighting
|
|
|
|
* When a hash is calculated using a single function call:
|
|
** The hashing function call
|
|
* When an object representing a weak hash function...
|
|
** ... is constructed:
|
|
*** The object construction statement
|
|
** ... is returned from a factory method provided by a supported framework/library:
|
|
*** The factory method call that returns the object
|
|
|
|
For example:
|
|
[source,csharp]
|
|
----
|
|
byte[] hash = MD5.HashData(data);
|
|
^^^^^^^^^^^^^^^^^^
|
|
HashAlgorithm obj1 = new MD5CryptoServiceProvider();
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
HashAlgorithm obj2 = HashAlgorithm.Create("MD5");
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
----
|