-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bytes * ## Supported Random Data
- Loading branch information
Showing
11 changed files
with
108 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
https://github.com/StefH/GitHubReleaseNotes | ||
|
||
GitHubReleaseNotes.exe --output ReleaseNotes.md --skip-empty-releases --version 1.0.9.0 | ||
GitHubReleaseNotes.exe --output ReleaseNotes.md --skip-empty-releases --version 1.0.10.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
| ||
namespace RandomDataGenerator.FieldOptions | ||
{ | ||
public class FieldOptionsBytes : FieldOptionsAbstract, IFieldOptionsBytes | ||
{ | ||
public int Min { get; set; } | ||
|
||
public int Max { get; set; } = 1024; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace RandomDataGenerator.FieldOptions | ||
{ | ||
public interface IFieldOptionsBytes | ||
{ | ||
int Min { get; set; } | ||
|
||
int Max { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Text; | ||
using JetBrains.Annotations; | ||
|
||
namespace RandomDataGenerator.Randomizers | ||
{ | ||
public interface IRandomizerBytes | ||
{ | ||
byte[] Generate(); | ||
|
||
string GenerateAsUTF8String(); | ||
|
||
string GenerateAsASCIIString(); | ||
|
||
string GenerateAsBase64String(); | ||
|
||
string GenerateAsString([CanBeNull] Encoding encoding = null); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using RandomDataGenerator.FieldOptions; | ||
using RandomDataGenerator.Generators; | ||
using System; | ||
using System.Text; | ||
|
||
namespace RandomDataGenerator.Randomizers | ||
{ | ||
public class RandomizerBytes : RandomizerAbstract<FieldOptionsBytes>, IRandomizerBytes | ||
{ | ||
public RandomizerBytes(FieldOptionsBytes options) | ||
: base(options) | ||
{ | ||
} | ||
|
||
public byte[] Generate() | ||
{ | ||
return RandomValueGenerator.NextBytes(Options.Min, Options.Max); | ||
} | ||
|
||
public string GenerateAsString(Encoding encoding) | ||
{ | ||
return (encoding ?? Encoding.UTF8).GetString(Generate()); | ||
} | ||
|
||
public string GenerateAsUTF8String() | ||
{ | ||
return GenerateAsString(Encoding.UTF8); | ||
} | ||
|
||
public string GenerateAsASCIIString() | ||
{ | ||
return GenerateAsString(Encoding.ASCII); | ||
} | ||
|
||
public string GenerateAsBase64String() | ||
{ | ||
return Convert.ToBase64String(Generate()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters