1
0
mirror of https://github.com/XFox111/SimpleOTP.git synced 2026-04-22 08:00:45 +03:00

Created SecretGenerator.GenerateSecret (markdown)

2021-05-31 17:16:18 +03:00
parent f4bacfbb30
commit 91afcf2a0f
+22
@@ -0,0 +1,22 @@
Namespace: `SimpleOTP.Helpers`
Assembly: `SimpleOTP.dll`
Generate OTP secret key.
```csharp
public static string GenerateSecret(int length = 160);
```
### Parameters
`length` `Int32`
Length of the key in bits
It should belong to [128-160] bit span
Default is: 160 bits.
### Returns
Base32 encoded alphanumeric string with length form 16 to 20 characters.
### Remarks
CURRENTLY THIS GENERATOR WORKS CORRECTLY ONLY WITH 160-BIT LENGTHS. Set `length` at your own risk.