Show / Hide Table of Contents

SetSalt Method

SetSalt(ReadOnlyMemory<byte>)

Set the Salt property with the given value. If the input argument Length is 0, this will set the Salt to be null. Otherwise, it must be exactly 16 bytes. If not, this method will throw an exception.

C#
public void SetSalt(ReadOnlyMemory<byte> salt)

Parameters

Type Name Description
ReadOnlyMemory<byte> salt

The salt to use.

Exceptions

Type Condition
ArgumentException

The data, if there is any, is not exactly 16 bytes.

Remarks

This method will copy the input salt data, it will not copy a reference.

If there is a salt value already in this object, this method will overwrite it.

If the input salt argument is null or the Length is 0, this method will set the Salt property to null. The object will not be empty (IsEmpty) will be false), but there will be no salt.

In this article
Back to top Generated by DocFX