CapyKit/Documentation/Help/M_CapyKit_Helpers_SecurityHelper_GetSalt.md
2024-09-04 19:31:43 -05:00

45 lines
1.1 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# GetSalt Method
Generates a random byte array that can act as a salt.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.2
**C#**
``` C#
public static byte[] GetSalt(
int length = 32
)
```
**F#**
``` F#
static member GetSalt :
?length : int
(* Defaults:
let _length = defaultArg length 32
*)
-> byte[]
```
#### Parameters
<dl><dt>  <a href="https://learn.microsoft.com/dotnet/api/system.int32" target="_blank" rel="noopener noreferrer">Int32</a>  (Optional)</dt><dd>(Optional) The desired length of the generated byte array.</dd></dl>
#### Return Value
<a href="https://learn.microsoft.com/dotnet/api/system.byte" target="_blank" rel="noopener noreferrer">Byte</a>[]
An array of byte.
## Remarks
A default length of <a href="F_CapyKit_Helpers_SecurityHelper_SALT_SIZE.md">SALT_SIZE</a> is provided as a sane default. Larger values can be used for increased entropy.
## See Also
#### Reference
<a href="T_CapyKit_Helpers_SecurityHelper.md">SecurityHelper Class</a>
<a href="N_CapyKit_Helpers.md">CapyKit.Helpers Namespace</a>