C# Class BaseNcoding.Base

Show file Open project: KvanTTT/BaseNcoding

Protected Properties

Property Type Description
InvAlphabet int[]

Public Methods

Method Description
Base ( uint charsCount, string alphabet, char special, Encoding encoding = null, bool parallel = false ) : System
BigIntPow ( System.Numerics.BigInteger x, int exp ) : System.Numerics.BigInteger
Decode ( string data ) : byte[]
DecodeToString ( string data ) : string
Encode ( byte data ) : string
EncodeString ( string data ) : string
GetOptimalBitsCount ( uint charsCount, uint &charsCountInBits, uint maxBitsCount = 64, uint radix = 2 ) : int
GetOptimalBitsCount2 ( uint charsCount, uint &charsCountInBits, uint maxBitsCount = 64, bool base2BitsCount = false ) : int
IntPow ( ulong x, int exp ) : ulong
IsPowerOf2 ( uint x ) : bool

From: http://stackoverflow.com/a/600306/1046374

LCM ( int a, int b ) : int

From: http://stackoverflow.com/a/13569863/1046374

LogBase2 ( uint x ) : int
LogBase2 ( ulong x ) : int
LogBaseN ( uint x, uint n ) : int
LogBaseN ( ulong x, uint n ) : int
NextPowOf2 ( uint x ) : uint

Method Details

Base() public method

public Base ( uint charsCount, string alphabet, char special, Encoding encoding = null, bool parallel = false ) : System
charsCount uint
alphabet string
special char
encoding System.Text.Encoding
parallel bool
return System

BigIntPow() public static method

public static BigIntPow ( System.Numerics.BigInteger x, int exp ) : System.Numerics.BigInteger
x System.Numerics.BigInteger
exp int
return System.Numerics.BigInteger

Decode() public abstract method

public abstract Decode ( string data ) : byte[]
data string
return byte[]

DecodeToString() public method

public DecodeToString ( string data ) : string
data string
return string

Encode() public abstract method

public abstract Encode ( byte data ) : string
data byte
return string

EncodeString() public method

public EncodeString ( string data ) : string
data string
return string

GetOptimalBitsCount() public static method

public static GetOptimalBitsCount ( uint charsCount, uint &charsCountInBits, uint maxBitsCount = 64, uint radix = 2 ) : int
charsCount uint
charsCountInBits uint
maxBitsCount uint
radix uint
return int

GetOptimalBitsCount2() public static method

public static GetOptimalBitsCount2 ( uint charsCount, uint &charsCountInBits, uint maxBitsCount = 64, bool base2BitsCount = false ) : int
charsCount uint
charsCountInBits uint
maxBitsCount uint
base2BitsCount bool
return int

IntPow() public static method

public static IntPow ( ulong x, int exp ) : ulong
x ulong
exp int
return ulong

IsPowerOf2() public static method

From: http://stackoverflow.com/a/600306/1046374
public static IsPowerOf2 ( uint x ) : bool
x uint
return bool

LCM() public static method

From: http://stackoverflow.com/a/13569863/1046374
public static LCM ( int a, int b ) : int
a int
b int
return int

LogBase2() public static method

public static LogBase2 ( uint x ) : int
x uint
return int

LogBase2() public static method

public static LogBase2 ( ulong x ) : int
x ulong
return int

LogBaseN() public static method

public static LogBaseN ( uint x, uint n ) : int
x uint
n uint
return int

LogBaseN() public static method

public static LogBaseN ( ulong x, uint n ) : int
x ulong
n uint
return int

NextPowOf2() public static method

public static NextPowOf2 ( uint x ) : uint
x uint
return uint

Property Details

InvAlphabet protected property

protected int[] InvAlphabet
return int[]