Skip to content

bitbeans/helper-net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

helper-net Build status Build Status NuGet Version License

A small collection of useful helper methods that I use in several projects.

Status

Pull requests and/or optimization proposals are always welcome!

Scope

ArrayHelper

static T[] ConcatArrays<T>(params T[][] arrays)
static T[] ConcatArrays<T>(T[] arr1, T[] arr2)
static T[] SubArray<T>(T[] arr, int start, int length)
static T[] SubArray<T>(T[] arr, int start)
static bool ConstantTimeEquals(byte[] a, byte[] b)

ConvensionHelper

static byte[] IntegerToLittleEndian(int data)

CryptoHelper

static byte[] Xor(byte[] data, IReadOnlyList<byte> keys)

StreamHelper

static byte[] ReadFully(Stream input)

ShellHelper

static string Escape(string argument, bool quote = false)
static string ExecuteShellCommand(string filename, string arguments, int timeout = 9000)

PaddingHelper

static byte[] AddPkcs7(byte[] data, int paddingLength)
static byte[] RemovePkcs7(byte[] paddedByteArray)
static byte[] AddZero(byte[] data, int paddingLength)
static byte[] RemoveZero(byte[] paddedByteArray)

RandomHelper

SecureRandomProvider

static int Next()
static int Next(int maxValue)
static int Next(int minValue, int maxValue)
static void GetBytes(byte[] data)
static void GetNonZeroBytes(byte[] data)

RandomProvider

static int Next()
static int Next(int maxValue)
static int Next(int minValue, int maxValue)
static void GetBytes(byte[] data)

Well512RandomProvider

static int Next()
static int Next(int maxValue)
static int Next(int minValue, int maxValue)

License

MIT

About

A small collection of useful helper methods

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages