mirror of
https://github.com/wagesj45/CapyKit.git
synced 2024-11-14 04:03:36 -06:00
46 lines
1.1 KiB
Markdown
46 lines
1.1 KiB
Markdown
|
# 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>
|