Add project

Basic formatting applied. Unnecessary comments have been removed. Suspicious code is covered by TODO.
This commit is contained in:
2025-08-12 11:21:10 +09:00
parent bbcbe841a7
commit 33ab055b43
546 changed files with 176950 additions and 0 deletions

View File

@ -0,0 +1,35 @@
namespace GostCryptography.Asn1.Ber
{
public abstract class Asn1CharSet
{
private readonly int _aBitsPerChar;
private readonly int _uBitsPerChar;
protected internal Asn1CharSet(int nchars)
{
_uBitsPerChar = Asn1Integer.GetBitCount(nchars - 1);
_aBitsPerChar = 1;
while (_uBitsPerChar > _aBitsPerChar)
{
_aBitsPerChar = _aBitsPerChar << 1;
}
}
public abstract int MaxValue { get; }
public abstract int GetCharAtIndex(int index);
public abstract int GetCharIndex(int charValue);
public virtual int GetNumBitsPerChar(bool aligned)
{
if (!aligned)
{
return _uBitsPerChar;
}
return _aBitsPerChar;
}
}
}