Compare commits
No commits in common. "b4a59f5467bf62b164e1d99f38a8a88e85cbd264" and "5cdd592aab7954e3f4223d46c50660801f2d3c87" have entirely different histories.
b4a59f5467
...
5cdd592aab
4
.gitignore
vendored
4
.gitignore
vendored
@ -3,6 +3,4 @@
|
||||
/Python/Abstracts/AnPMap.py
|
||||
/Python/Abstracts/Applications.py
|
||||
.sass-cache
|
||||
__pycache__
|
||||
/CSharp/obj
|
||||
/CSharp/bin
|
||||
__pycache__
|
||||
@ -1,608 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace ErrorsManager{
|
||||
|
||||
public class ErrorsManager{
|
||||
|
||||
public static readonly char[] ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".ToCharArray();
|
||||
|
||||
public static readonly string[] ERRORS_MESSAGES = new string[]{
|
||||
"invalid_alphabet",
|
||||
"invalid_base",
|
||||
"invalid_alphabet_type",
|
||||
"too_short_alphabet",
|
||||
"repeated_characters_in_alphabet",
|
||||
"too_long_alphabet",
|
||||
"base_lower_than_2",
|
||||
"base_greater_than_128",
|
||||
"base_greater_than_alphabet"
|
||||
};
|
||||
|
||||
public static readonly Regex RE_KEY = new Regex(@"^[a-z_][a-z0-9_]*$", RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
|
||||
private int error = 0;
|
||||
private char[] alphabet = new char[0];
|
||||
private Dictionary<char, byte> dictionary = new Dictionary<char, byte>();
|
||||
private byte _base;
|
||||
private byte power;
|
||||
|
||||
public ErrorsManager(object inputs = null){
|
||||
|
||||
set_alphabet(
|
||||
get<object>("alphabet", inputs, ALPHABET),
|
||||
get<int>("base", inputs, 64)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public int set_alphabet(object alphabet = null, int _base = 64){
|
||||
|
||||
int original_length;
|
||||
|
||||
error = 0;
|
||||
|
||||
if(alphabet == null)
|
||||
this.alphabet = ALPHABET;
|
||||
else if(alphabet is string alphabet_string)
|
||||
this.alphabet = alphabet_string.ToCharArray();
|
||||
else if(alphabet is IEnumerable<char> alphabet_enumerable)
|
||||
this.alphabet = alphabet_enumerable.ToArray<char>();
|
||||
else{
|
||||
error |= 1 << 2;
|
||||
this.alphabet = ALPHABET;
|
||||
}
|
||||
|
||||
original_length = this.alphabet.Length;
|
||||
|
||||
this.alphabet = this.alphabet.Distinct<char>().ToArray<char>();
|
||||
|
||||
if(this.alphabet.Length < 2){
|
||||
error |= 1 << 3;
|
||||
this.alphabet = ALPHABET;
|
||||
}
|
||||
if(this.alphabet.Length != original_length)
|
||||
error |= 1 << 4;
|
||||
if(this.alphabet.Length > 128)
|
||||
error |= 1 << 5;
|
||||
|
||||
error |= (
|
||||
_base < 2 ? 1 << 0 :
|
||||
_base > 128 ? 1 << 1 :
|
||||
_base >= this.alphabet.Length ? 1 << 2 :
|
||||
0) << 6;
|
||||
|
||||
if(error >> 6 == 0)
|
||||
this.alphabet = this.alphabet.Take(_base).ToArray<char>();
|
||||
|
||||
this.alphabet = this.alphabet.Take(
|
||||
this._base = (byte)Math.Pow(2,
|
||||
power = (byte)Math.Log2(this.alphabet.Take(128).Count<char>())
|
||||
)
|
||||
).ToArray<char>();
|
||||
|
||||
dictionary.Clear();
|
||||
for(byte i = 0; i < this.alphabet.Length; i ++)
|
||||
dictionary[this.alphabet[i]] = i;
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
public string get_alphabet(){
|
||||
return new string(alphabet);
|
||||
}
|
||||
|
||||
public byte[] to_array(string code){
|
||||
return code.Select<char, byte>(character => dictionary[character]).ToArray<byte>();
|
||||
}
|
||||
|
||||
public byte[] to_array(byte[] code){
|
||||
return code;
|
||||
}
|
||||
|
||||
public byte[] to_array(int code){
|
||||
|
||||
List<byte> hexas = new List<byte>();
|
||||
|
||||
while(code != 0){
|
||||
hexas.Add((byte)(code % _base));
|
||||
code /= _base;
|
||||
}
|
||||
|
||||
return hexas.ToArray<byte>();
|
||||
}
|
||||
|
||||
public string to_string(byte[] code){
|
||||
return new string(code.Select<byte, char>(value => alphabet[value]).ToArray<char>());
|
||||
}
|
||||
|
||||
public string to_string(int code){
|
||||
string hexas = "";
|
||||
|
||||
while(code != 0){
|
||||
hexas += alphabet[(byte)(code % _base)];
|
||||
code /= _base;
|
||||
}
|
||||
|
||||
return hexas;
|
||||
}
|
||||
|
||||
public string to_string(string code){
|
||||
return code;
|
||||
}
|
||||
|
||||
public int to_integer(string code){
|
||||
|
||||
int _string = 0;
|
||||
|
||||
for(int i = code.Length - 1; i >= 0; i --)
|
||||
_string = _string * _base + dictionary[code[i]];
|
||||
|
||||
return _string;
|
||||
}
|
||||
|
||||
public int to_integer(byte[] code){
|
||||
|
||||
int array = 0;
|
||||
|
||||
for(int i = code.Length - 1; i >= 0; i --)
|
||||
array = array * _base + code[i];
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
public int to_integer(int code){
|
||||
return code;
|
||||
}
|
||||
|
||||
public string to_string_binary(string code){
|
||||
return string.Join("", code.Reverse<char>().Select<char, string>(character => Convert.ToString(dictionary[character], 2).PadLeft(power, '0')));
|
||||
}
|
||||
|
||||
public string to_string_binary(byte[] code){
|
||||
return string.Join("", code.Reverse<byte>().Select<byte, string>(hexa => Convert.ToString(hexa, 2).PadLeft(power, '0')));
|
||||
}
|
||||
|
||||
public string to_string_binary(int code){
|
||||
|
||||
string binary = Convert.ToString(code, 2);
|
||||
int remainer = binary.Length % power;
|
||||
|
||||
return (
|
||||
remainer == 0 ? binary :
|
||||
binary.PadLeft(binary.Length + power - remainer, '0'));
|
||||
}
|
||||
|
||||
public (int, string)[] process(string code, IEnumerable<string> messages){
|
||||
return process(to_array(code), messages);
|
||||
}
|
||||
|
||||
public (int, string)[] process(byte[] code, IEnumerable<string> messages){
|
||||
|
||||
List<(int, string)> response = new List<(int, string)>();
|
||||
|
||||
for_each_enumerate(code, (hexa, i) => {
|
||||
for(byte j = 0; j < power && (hexa & 1 << j) <= hexa; j ++)
|
||||
if((hexa & 1 << j) != 0){
|
||||
|
||||
int x = i * power + j;
|
||||
|
||||
response.Add((x, messages.ElementAtOrDefault(x) ?? "error_message_" + x.ToString()));
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
return response.ToArray();
|
||||
}
|
||||
|
||||
public (int, string)[] process(int code, IEnumerable<string> messages){
|
||||
return process(to_array(code), messages);
|
||||
}
|
||||
|
||||
public int get_bits(string code){
|
||||
return code.Length == 0 ? 0 : (code.Length - 1) * power + (int)Math.Ceiling(Math.Log2(dictionary[code.Last<char>()] + 1));
|
||||
}
|
||||
|
||||
public int get_bits(byte[] code){
|
||||
return code.Length == 0 ? 0 : (code.Length - 1) * power + (int)Math.Ceiling(Math.Log2(code.Last<byte>() + 1));
|
||||
}
|
||||
|
||||
public int get_bits(int code){
|
||||
return (int)Math.Ceiling(Math.Log2(code + 1));
|
||||
}
|
||||
|
||||
public string clean(string code){
|
||||
|
||||
int l = code.Length;
|
||||
|
||||
while(l > 0 && code[l - 1] == alphabet[0])
|
||||
l --;
|
||||
|
||||
return (
|
||||
code.Length == l ? code :
|
||||
l == 0 ? alphabet[0].ToString() :
|
||||
code.Substring(0, l));
|
||||
}
|
||||
|
||||
public byte[] clean(byte[] code){
|
||||
|
||||
int l = code.Length;
|
||||
|
||||
while(l > 0 && code[l - 1] == 0)
|
||||
l --;
|
||||
|
||||
return (
|
||||
l == code.Length ? code :
|
||||
l == 0 ? new byte[]{0} :
|
||||
code.Take(l).ToArray<byte>());
|
||||
}
|
||||
|
||||
public int clean(int code){
|
||||
return code;
|
||||
}
|
||||
|
||||
public string bitwise(string code, int bits){
|
||||
return to_string(bitwise(to_array(code), bits));
|
||||
}
|
||||
public byte[] bitwise(byte[] code, int bits){
|
||||
if(code.Length == 0 || bits == 0)
|
||||
return code;
|
||||
|
||||
byte shift = (byte)(Math.Abs(bits) % power);
|
||||
int mask = _base - 1;
|
||||
List<byte> hexas = code.ToList<byte>();
|
||||
|
||||
if(bits < 0){
|
||||
|
||||
hexas.RemoveRange(0, (int)(-bits / power));
|
||||
|
||||
if(shift != 0 && hexas.Count != 0){
|
||||
|
||||
int l = hexas.Count - 1;
|
||||
|
||||
for(int i = 0; i < l; i ++)
|
||||
hexas[i] = (byte)((hexas[i] >> shift) | ((hexas[i + 1] << (power - shift)) & mask));
|
||||
hexas[hexas.Count - 1] >>= shift;
|
||||
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
if(shift != 0){
|
||||
|
||||
int last_hexa = hexas[hexas.Count - 1] << shift;
|
||||
|
||||
for(int i = hexas.Count - 1; i > 0; i --)
|
||||
hexas[i] = (byte)(((hexas[i] << shift) & mask) | (hexas[i - 1] >> (power - shift)));
|
||||
hexas[0] = (byte)((hexas[0] << shift) & mask);
|
||||
|
||||
if(last_hexa >= _base)
|
||||
hexas.Add((byte)(last_hexa >> power));
|
||||
|
||||
}
|
||||
|
||||
for(int i = bits / power; i > 0; i --)
|
||||
hexas.Insert(0, 0);
|
||||
|
||||
}
|
||||
|
||||
return clean(hexas.ToArray<byte>());
|
||||
}
|
||||
|
||||
public int bitwise(int code, int bits){
|
||||
return (
|
||||
bits > 0 ? code << bits :
|
||||
bits < 0 ? code >> -bits :
|
||||
code);
|
||||
}
|
||||
|
||||
public void get_from_bits(string code, ref int from, ref int bits){
|
||||
get_from_bits(to_array(code), ref from, ref bits);
|
||||
}
|
||||
|
||||
public void get_from_bits(byte[] code, ref int from, ref int bits){
|
||||
if(from < 0){
|
||||
from = get_bits(code) + from;
|
||||
if(from < 0)
|
||||
from = 0;
|
||||
}
|
||||
if(bits < 0){
|
||||
from += bits;
|
||||
bits *= -1;
|
||||
if(from < 0){
|
||||
bits += from;
|
||||
from = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void get_from_bits(int code, ref int from, ref int bits){
|
||||
get_from_bits(to_array(code), ref from, ref bits);
|
||||
}
|
||||
|
||||
public string reset(string code, int from, int bits = 0, bool reversed = false){
|
||||
return to_string(reset(to_array(code), from, bits, reversed));
|
||||
}
|
||||
|
||||
public byte[] reset(byte[] code, int from, int bits = 0, bool reversed = false){
|
||||
|
||||
List<byte> hexas = code.ToList<byte>();
|
||||
int hexa_from;
|
||||
int hexa_to;
|
||||
int l;
|
||||
byte from_mask;
|
||||
byte to_mask;
|
||||
|
||||
get_from_bits(code, ref from, ref bits);
|
||||
hexa_from = (int)(from / power);
|
||||
hexa_to = (int)((from + bits) / power);
|
||||
|
||||
if(reversed){
|
||||
|
||||
l = from % power;
|
||||
from_mask = (byte)(~-(1 << power - l) << l);
|
||||
to_mask = (byte)~-(1 << (from + bits) % power);
|
||||
|
||||
for(int i = 0; i < hexas.Count; i ++)
|
||||
if(i < hexa_from || i > hexa_to)
|
||||
hexas[i] = 0;
|
||||
|
||||
if(hexa_from == hexa_to)
|
||||
hexas[hexa_to] &= (byte)(from_mask & to_mask);
|
||||
else{
|
||||
hexas[hexa_from] &= from_mask;
|
||||
if(hexa_to < hexas.Count)
|
||||
hexas[hexa_to] &= to_mask;
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
l = (from + bits) % power;
|
||||
from_mask = (byte)~-(1 << (from % power));
|
||||
to_mask = (byte)(~-(1 << power - l) << l);
|
||||
|
||||
if(hexa_from == hexa_to){
|
||||
hexas[hexa_to] &= (byte)(from_mask | to_mask);
|
||||
}else{
|
||||
hexas[hexa_from] &= from_mask;
|
||||
for(int i = hexa_from + 1; i < hexa_to && i < hexas.Count; i ++)
|
||||
hexas[i] = 0;
|
||||
if(hexa_to < hexas.Count)
|
||||
hexas[hexa_to] &= to_mask;
|
||||
}
|
||||
}
|
||||
|
||||
return hexas.ToArray<byte>();
|
||||
}
|
||||
|
||||
public int reset(int code, int from, int bits = 0, bool reversed = false){
|
||||
|
||||
get_from_bits(code, ref from, ref bits);
|
||||
if(from + bits > 31)
|
||||
bits = 31 - from;
|
||||
|
||||
return code & (reversed ?
|
||||
~-(1 << bits) << from :
|
||||
(~-(1 << get_bits(code)) << from + bits) | ~-(1 << from));
|
||||
|
||||
}
|
||||
|
||||
public string get_range(string code, int from, int bits = 0){
|
||||
return to_string(get_range(to_array(code), from, bits));
|
||||
}
|
||||
|
||||
public byte[] get_range(byte[] code, int from, int bits = 0){
|
||||
|
||||
List<byte> hexas;
|
||||
|
||||
get_from_bits(code, ref from, ref bits);
|
||||
|
||||
if(bits == 0)
|
||||
bits = get_bits(code) - from;
|
||||
if(bits <= 0)
|
||||
return new byte[]{0};
|
||||
|
||||
hexas = code.ToList<byte>();
|
||||
|
||||
if(from > 0){
|
||||
|
||||
byte shift = (byte)(from % power);
|
||||
int mask = ~-_base;
|
||||
|
||||
hexas = hexas.Skip(from / power).ToList<byte>();
|
||||
if(shift != 0 && hexas.Count > 0){
|
||||
|
||||
int l = hexas.Count - 1;
|
||||
for(int i = 0; i < l; i ++)
|
||||
hexas[i] = (byte)((hexas[i] >> shift) | ((hexas[i + 1] << (power - shift)) & mask));
|
||||
hexas[hexas.Count - 1] >>= shift;
|
||||
}
|
||||
|
||||
}
|
||||
if(bits > 0){
|
||||
|
||||
byte shift = (byte)(bits % power);
|
||||
|
||||
hexas = hexas.Take<byte>((int)Math.Ceiling(bits / (double)power)).ToList<byte>();
|
||||
if(shift != 0 && hexas.Count > 0)
|
||||
hexas[hexas.Count - 1] &= (byte)((1 << shift) - 1);
|
||||
|
||||
}
|
||||
|
||||
return clean(hexas.ToArray<byte>());
|
||||
}
|
||||
|
||||
public int get_range(int code, int from, int bits = 0){
|
||||
|
||||
get_from_bits(code, ref from, ref bits);
|
||||
|
||||
if(from > 0)
|
||||
code = (code >> from) & ((1 << (31 - from)) - 1);
|
||||
|
||||
if(bits <= 0 || bits >= 31)
|
||||
return code;
|
||||
|
||||
if(from + bits > 31)
|
||||
bits = 31 - from;
|
||||
|
||||
return code & ((1 << bits) - 1);
|
||||
}
|
||||
|
||||
public bool has(string code, int from = 0, int bits = 0){
|
||||
foreach(char character in get_range(code, from, bits))
|
||||
if(character != alphabet[0])
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool has(byte[] code, int from = 0, int bits = 0){
|
||||
foreach(byte hexa in get_range(code, from, bits))
|
||||
if(hexa != 0)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool has(int code, int from = 0, int bits = 0){
|
||||
return get_range(code, from, bits) != 0;
|
||||
}
|
||||
|
||||
public string set(string error, string code, int _from = 0, int bits = 0){
|
||||
return to_string(set(to_array(error), to_array(code), _from, bits));
|
||||
}
|
||||
|
||||
public string set(string error, byte[] code, int _from = 0, int bits = 0){
|
||||
return to_string(set(to_array(error), code, _from, bits));
|
||||
}
|
||||
|
||||
public string set(string error, int code, int _from = 0, int bits = 0){
|
||||
return to_string(set(to_array(error), to_array(code), _from, bits));
|
||||
}
|
||||
|
||||
public byte[] set(byte[] error, string code, int _from = 0, int bits = 0){
|
||||
return set(error, to_array(code), _from, bits);
|
||||
}
|
||||
|
||||
public byte[] set(byte[] error, byte[] code, int _from = 0, int bits = 0){
|
||||
|
||||
int l;
|
||||
int m = error.Length;
|
||||
int n = code.Length;
|
||||
List<byte> results = new List<byte>();
|
||||
|
||||
if(bits != 0)
|
||||
error = reset(error, _from, bits);
|
||||
if(_from != 0)
|
||||
n = (code = bitwise(code, _from)).Length;
|
||||
l = m > n ? m : n;
|
||||
|
||||
for(int i = 0; i < l; i ++)
|
||||
results.Add((byte)(
|
||||
(i < m ? error[i] : (byte)0) | (i < n ? code[i] : (byte)0)
|
||||
));
|
||||
|
||||
return clean(results.ToArray<byte>());
|
||||
}
|
||||
|
||||
public byte[] set(byte[] error, int code, int _from = 0, int bits = 0){
|
||||
return set(error, to_array(code), _from, bits);
|
||||
}
|
||||
|
||||
public int set(int error, string code, int _from = 0, int bits = 0){
|
||||
return to_integer(set(error, to_integer(code), _from, bits));
|
||||
}
|
||||
|
||||
public int set(int error, byte[] code, int _from = 0, int bits = 0){
|
||||
return to_integer(set(error, to_integer(code), _from, bits));
|
||||
}
|
||||
|
||||
public int set(int error, int code, int _from = 0, int bits = 0){
|
||||
if(bits != 0)
|
||||
error = reset(error, _from, bits);
|
||||
if(_from != 0)
|
||||
code = bitwise(code, _from);
|
||||
return error | code;
|
||||
}
|
||||
|
||||
public static List<string> get_keys(object items){
|
||||
|
||||
List<string> keys = new List<string>();
|
||||
|
||||
if(items is string item_string){
|
||||
if(RE_KEY.IsMatch(item_string))
|
||||
keys.Add(item_string);
|
||||
}else if(items is IEnumerable<string> strings){
|
||||
foreach(string item_i in strings)
|
||||
if(!keys.Contains(item_i) && RE_KEY.IsMatch(item_i))
|
||||
keys.Add(item_i);
|
||||
}else if(items is IEnumerable<object> list)
|
||||
foreach(object item in list){
|
||||
if(item == null)
|
||||
continue;
|
||||
if(item is string string_item){
|
||||
if(!keys.Contains(string_item) && RE_KEY.IsMatch(string_item))
|
||||
keys.Add(string_item);
|
||||
}else
|
||||
foreach(string key in get_keys(item))
|
||||
if(!keys.Contains(key) && RE_KEY.IsMatch(key))
|
||||
keys.Add(key);
|
||||
}
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
public static List<Dictionary<string, object>> get_dictionaries(object items){
|
||||
|
||||
List<Dictionary<string, object>> dictionaries = new List<Dictionary<string, object>>();
|
||||
|
||||
if(items is Dictionary<string, object> dictionary)
|
||||
dictionaries.Add(dictionary);
|
||||
else if(items is IEnumerable<object> list)
|
||||
foreach(object item in list)
|
||||
dictionaries.AddRange(get_dictionaries(item));
|
||||
|
||||
return dictionaries;
|
||||
}
|
||||
|
||||
public static T get<T>(object keys, object dictionaries, T _default = default(T)){
|
||||
|
||||
List<string> keys_list = get_keys(keys);
|
||||
|
||||
if(keys_list.Count != 0)
|
||||
foreach(Dictionary<string, object> dictionary in get_dictionaries(dictionaries))
|
||||
foreach(string key in keys_list)
|
||||
if(dictionary.TryGetValue(key, out object value) && value is T typed)
|
||||
return typed;
|
||||
return _default;
|
||||
}
|
||||
|
||||
public static T[] unique<T>(IEnumerable<T> items){
|
||||
return items.Distinct<T>().ToArray<T>();
|
||||
}
|
||||
|
||||
public static bool is_string(object value){
|
||||
return value is string;
|
||||
}
|
||||
|
||||
public static bool is_array(object value){
|
||||
return value is byte[];
|
||||
}
|
||||
|
||||
public static bool is_integer(object value){
|
||||
return value is int;
|
||||
}
|
||||
|
||||
public static void for_each_enumerate<T>(IEnumerable<T> items, Action<T, int> action){
|
||||
|
||||
int i = 0;
|
||||
|
||||
foreach(T item in items)
|
||||
action(item, i ++);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<!-- <OutputType>Library</OutputType> -->
|
||||
<TargetFrameworks>net10.0;net462</TargetFrameworks>
|
||||
<!-- <Nullable>enable</Nullable> -->
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>ErrorsManager</RootNamespace>
|
||||
<AssemblyName>ErrorsManager</AssemblyName>
|
||||
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ErrorsManager.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Tests.cs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@ -1,3 +0,0 @@
|
||||
<Solution>
|
||||
<Project Path="ErrorsManager.csproj" />
|
||||
</Solution>
|
||||
@ -1,18 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace ErrorsManager{
|
||||
class Program{
|
||||
public static void Main(string[] args){
|
||||
|
||||
// Tests.errors();
|
||||
// Tests.conversions();
|
||||
// Tests.alphabet();
|
||||
// Tests.bitwise();
|
||||
// Tests.bitwise_sucesive();
|
||||
// Tests.bits();
|
||||
// Tests.reset();
|
||||
Tests.ranges();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
241
CSharp/Tests.cs
241
CSharp/Tests.cs
@ -1,241 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace ErrorsManager{
|
||||
|
||||
class FullError{
|
||||
|
||||
public int integer;
|
||||
public string _string;
|
||||
public byte[] array;
|
||||
|
||||
public FullError(ErrorsManager errors, int integer){
|
||||
this.integer = integer;
|
||||
_string = errors.to_string(integer);
|
||||
array = errors.to_array(integer);
|
||||
}
|
||||
|
||||
public FullError(ErrorsManager errors, string _string){
|
||||
integer = errors.to_integer(_string);
|
||||
this._string = _string;
|
||||
array = errors.to_array(_string);
|
||||
}
|
||||
|
||||
public FullError(ErrorsManager errors, byte[] array){
|
||||
integer = errors.to_integer(array);
|
||||
_string = errors.to_string(array);
|
||||
this.array = array;
|
||||
}
|
||||
|
||||
public static string print(byte[] array){
|
||||
return "[" + string.Join(", ", array) + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Tests{
|
||||
|
||||
public static void errors(){
|
||||
|
||||
ErrorsManager errors = new ErrorsManager();
|
||||
FullError error = new FullError(errors, 217934237);
|
||||
FullError reset = new FullError(errors, 0);
|
||||
|
||||
reset.integer = errors.reset(error.integer, -5, 12);
|
||||
reset._string = errors.reset(error._string, -5, 12);
|
||||
reset.array = errors.reset(error.array, -5, 12);
|
||||
|
||||
Console.WriteLine($"RESET: from {-5} bits {12}");
|
||||
Console.WriteLine($"INTEGER: {errors.to_string_binary(error.integer)} - {errors.to_string_binary(reset.integer)}");
|
||||
Console.WriteLine($"STRING: {errors.to_string_binary(error._string)} - {errors.to_string_binary(reset._string)}");
|
||||
Console.WriteLine($"ARRAY: {errors.to_string_binary(error.array)} - {errors.to_string_binary(reset.array)}");
|
||||
Console.WriteLine();
|
||||
|
||||
}
|
||||
|
||||
public static ErrorsManager conversions(int tests = 10, object inputs = null){
|
||||
|
||||
ErrorsManager errors = new ErrorsManager(inputs);
|
||||
Random seed = new Random();
|
||||
|
||||
for(int i = 0; i < tests; i ++){
|
||||
|
||||
FullError error = new FullError(errors, seed.Next(0, 1 << 16));
|
||||
|
||||
Console.WriteLine($"INTEGER: {errors.to_integer(error.integer)}, {errors.to_integer(error._string)}, {errors.to_integer(error.array)}");
|
||||
Console.WriteLine($"STRING: {errors.to_string(error.integer)}, {errors.to_string(error._string)}, {errors.to_string(error.array)}");
|
||||
Console.WriteLine($"ARRAY: {FullError.print(errors.to_array(error.integer))}, {FullError.print(errors.to_array(error._string))}, {FullError.print(errors.to_array(error.array))}");
|
||||
Console.WriteLine();
|
||||
|
||||
}
|
||||
|
||||
return errors;
|
||||
}
|
||||
|
||||
public static void alphabet(int tests = 10){
|
||||
|
||||
Random seed = new Random();
|
||||
|
||||
for(int i = 0; i < tests; i ++){
|
||||
|
||||
ErrorsManager errors = conversions(1, new Dictionary<string, object>() {
|
||||
{"base", seed.Next(2, 128)}
|
||||
});
|
||||
|
||||
Console.WriteLine($"^^^ ALPHABET: {string.Join(", ", errors.get_alphabet())} ^^^");
|
||||
Console.WriteLine();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static void bitwise(int tests = 10){
|
||||
|
||||
ErrorsManager errors = new ErrorsManager();
|
||||
Random seed = new Random();
|
||||
|
||||
for(int i = 0; i < tests; i ++){
|
||||
|
||||
FullError error = new FullError(errors, seed.Next(0, 1 << seed.Next(0, 16)));
|
||||
FullError shifted = new FullError(errors, 0);
|
||||
FullError unshifted = new FullError(errors, 0);
|
||||
int bitwise = 10 - seed.Next(0, 20);
|
||||
|
||||
Console.WriteLine($"BITWISE: {bitwise}");
|
||||
|
||||
shifted.integer = errors.bitwise(error.integer, bitwise);
|
||||
shifted._string = errors.bitwise(error._string, bitwise);
|
||||
shifted.array = errors.bitwise(error.array, bitwise);
|
||||
unshifted.integer = errors.bitwise(shifted.integer, -bitwise);
|
||||
unshifted._string = errors.bitwise(shifted._string, -bitwise);
|
||||
unshifted.array = errors.bitwise(shifted.array, -bitwise);
|
||||
|
||||
Console.WriteLine($"INTEGER: {errors.to_string_binary(error.integer)} - {error.integer}");
|
||||
Console.WriteLine($"STRING: {errors.to_string_binary(error._string)} - {error._string}");
|
||||
Console.WriteLine($"ARRAY: {errors.to_string_binary(error.array)} - {FullError.print(error.array)}");
|
||||
Console.WriteLine($"INTEGER: {errors.to_string_binary(shifted.integer)} - {shifted.integer}");
|
||||
Console.WriteLine($"STRING: {errors.to_string_binary(shifted._string)} - {shifted._string}");
|
||||
Console.WriteLine($"ARRAY: {errors.to_string_binary(shifted.array)} - {FullError.print(shifted.array)}");
|
||||
Console.WriteLine($"INTEGER: {errors.to_string_binary(unshifted.integer)} - {unshifted.integer}");
|
||||
Console.WriteLine($"STRING: {errors.to_string_binary(unshifted._string)} - {unshifted._string}");
|
||||
Console.WriteLine($"ARRAY: {errors.to_string_binary(unshifted.array)} - {FullError.print(unshifted.array)}");
|
||||
Console.WriteLine();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void bitwise_sucesive(int tests = 10){
|
||||
|
||||
ErrorsManager errors = new ErrorsManager();
|
||||
FullError error = new FullError(errors, new Random().Next(0, 1 << 16));
|
||||
|
||||
Console.WriteLine($"INTEGER: {errors.to_string_binary(error.integer)} - {error.integer}");
|
||||
Console.WriteLine($"STRING: {errors.to_string_binary(error._string)} - {error._string}");
|
||||
Console.WriteLine($"ARRAY: {errors.to_string_binary(error.array)} - {FullError.print(error.array)}");
|
||||
Console.WriteLine();
|
||||
|
||||
for(int i = -tests; i < tests; i ++){
|
||||
|
||||
FullError shifted = new FullError(errors, 0);
|
||||
|
||||
Console.WriteLine($"BITWISE: {i}");
|
||||
|
||||
shifted.integer = errors.bitwise(error.integer, i);
|
||||
shifted._string = errors.bitwise(error._string, i);
|
||||
shifted.array = errors.bitwise(error.array, i);
|
||||
|
||||
|
||||
Console.WriteLine($"INTEGER: {errors.to_string_binary(shifted.integer)} - {shifted.integer}");
|
||||
Console.WriteLine($"STRING: {errors.to_string_binary(shifted._string)} - {shifted._string}");
|
||||
Console.WriteLine($"ARRAY: {errors.to_string_binary(shifted.array)} - {FullError.print(shifted.array)}");
|
||||
Console.WriteLine();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void bits(int tests = 10){
|
||||
|
||||
ErrorsManager errors = new ErrorsManager();
|
||||
Random seed = new Random();
|
||||
|
||||
for(int i = 0; i < tests; i++){
|
||||
|
||||
FullError error = new FullError(errors, seed.Next(0, 1 << seed.Next(0, 28)));
|
||||
int from_value = seed.Next(-15, 15);
|
||||
int bits_value = seed.Next(-13, 13);
|
||||
int[] from = new int[]{from_value, from_value, from_value};
|
||||
int[] bits = new int[]{bits_value, bits_value, bits_value};
|
||||
|
||||
errors.get_from_bits(error.integer, ref from[0], ref bits[0]);
|
||||
errors.get_from_bits(error._string, ref from[1], ref bits[1]);
|
||||
errors.get_from_bits(error.array, ref from[2], ref bits[2]);
|
||||
|
||||
|
||||
Console.WriteLine($"CODE: {error.integer} - {error._string} - {FullError.print(error.array)}");
|
||||
Console.WriteLine($"ERROR: {errors.to_string_binary(error.integer)} - {errors.get_bits(error.integer)} - {errors.get_bits(error._string)} - {errors.get_bits(error.array)}");
|
||||
Console.WriteLine($"FROM: {from_value} - {from[0]}, {from[1]}, {from[2]}");
|
||||
Console.WriteLine($"BITS: {bits_value} - {bits[0]}, {bits[1]}, {bits[2]}");
|
||||
Console.WriteLine();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void reset(int tests = 10){
|
||||
|
||||
ErrorsManager errors = new ErrorsManager();
|
||||
Random seed = new Random();
|
||||
|
||||
for(int i = 0; i < tests; i ++){
|
||||
|
||||
FullError error = new FullError(errors, seed.Next(0, 1 << 28));
|
||||
int from = seed.Next(-15, 15);
|
||||
int bits = seed.Next(-13, 13);
|
||||
FullError reset = new FullError(errors, 0);
|
||||
|
||||
reset.integer = errors.reset(error.integer, from, bits);
|
||||
reset._string = errors.reset(error._string, from, bits);
|
||||
reset.array = errors.reset(error.array, from, bits);
|
||||
|
||||
Console.WriteLine($"RESET: from {from} bits {bits}");
|
||||
Console.WriteLine($"INTEGER: {errors.to_string_binary(error.integer)} - {errors.to_string_binary(reset.integer)}");
|
||||
Console.WriteLine($"STRING: {errors.to_string_binary(error._string)} - {errors.to_string_binary(reset._string)}");
|
||||
Console.WriteLine($"ARRAY: {errors.to_string_binary(error.array)} - {errors.to_string_binary(reset.array)}");
|
||||
Console.WriteLine();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void ranges(int tests = 10){
|
||||
|
||||
ErrorsManager errors = new ErrorsManager();
|
||||
Random seed = new Random();
|
||||
|
||||
for(int i = 0; i < tests; i ++){
|
||||
|
||||
FullError error = new FullError(errors, seed.Next(0, 1 << 28));
|
||||
int from = seed.Next(-15, 15);
|
||||
int bits = seed.Next(-13, 13);
|
||||
FullError range = new FullError(errors, 0);
|
||||
|
||||
Console.WriteLine($"RANGE: from {from} bits {bits}");
|
||||
errors.get_from_bits(error._string, ref from, ref bits);
|
||||
Console.WriteLine($"REAL: from {from} bits {bits}");
|
||||
|
||||
range.integer = errors.get_range(error.integer, from, bits);
|
||||
range._string = errors.get_range(error._string, from, bits);
|
||||
range.array = errors.get_range(error.array, from, bits);
|
||||
|
||||
Console.WriteLine($"INTEGER: {errors.to_string_binary(error.integer)} - {errors.to_string_binary(range.integer)}");
|
||||
Console.WriteLine($"STRING: {errors.to_string_binary(error._string)} - {errors.to_string_binary(range._string)}");
|
||||
Console.WriteLine($"ARRAY: {errors.to_string_binary(error.array)} - {errors.to_string_binary(range.array)}");
|
||||
Console.WriteLine();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -19,7 +19,7 @@ class ErrorsManager:
|
||||
self.__alphabet:tuple[str] = (
|
||||
tuple(alphabet) if isinstance(alphabet, (list, str)) else
|
||||
alphabet)
|
||||
self.__alphabet_map:dict[str, int] = {character : i for i, character in enumerate(self.__alphabet)}
|
||||
self.__alphabet_dictionary:dict[str, int] = {character : i for i, character in enumerate(self.__alphabet)}
|
||||
self.__base:int = self.get_value("base", inputs, maximum_base)
|
||||
self.__mask:int
|
||||
|
||||
@ -52,7 +52,7 @@ class ErrorsManager:
|
||||
hexa:str
|
||||
|
||||
for i, hexa in enumerate(reversed(code)):
|
||||
integer |= self.__alphabet_map[hexa] << self.__base * i
|
||||
integer |= self.__alphabet_dictionary[hexa] << self.__base * i
|
||||
|
||||
return integer
|
||||
if isinstance(code, (list, tuple)):
|
||||
@ -70,7 +70,7 @@ class ErrorsManager:
|
||||
|
||||
def to_array(self:Self, code:str|int|Sequence[int]) -> list[int]:
|
||||
if isinstance(code, str):
|
||||
return [self.__alphabet_map[hexa] for hexa in code]
|
||||
return [self.__alphabet_dictionary[hexa] for hexa in code]
|
||||
if isinstance(code, list):
|
||||
return list(code)
|
||||
if isinstance(code, tuple):
|
||||
@ -86,10 +86,10 @@ class ErrorsManager:
|
||||
return list(reversed(array))
|
||||
return []
|
||||
|
||||
def reset_bak(self:Self, code:int, start:int, length:int) -> int:
|
||||
def reset(self:Self, code:int, start:int, length:int) -> int:
|
||||
return code and (code & ~(~-(1 << length) << start))
|
||||
|
||||
def set_bak(self:Self, code:int, map:Sequence[int], codes:Sequence[int], start:int = 0, clean_bits:int = 0) -> int:
|
||||
def set(self:Self, code:int, map:Sequence[int], codes:Sequence[int], start:int = 0, clean_bits:int = 0) -> int:
|
||||
|
||||
new_code:int = 0
|
||||
shift:int = 0
|
||||
@ -105,71 +105,10 @@ class ErrorsManager:
|
||||
return (
|
||||
(code & ~-(1 << start)) |
|
||||
(new_code << start) |
|
||||
# ((code >> start + shift) << start + shift)
|
||||
(code & ~(~-(1 << start + shift)))
|
||||
)
|
||||
|
||||
def has(self:Self, code:str) -> bool:
|
||||
|
||||
errors:tuple[str] = self.__alphabet[1:]
|
||||
character:str
|
||||
|
||||
for character in code:
|
||||
if character in errors:
|
||||
return True
|
||||
return False
|
||||
|
||||
def clean(self:Self, code:str) -> str:
|
||||
|
||||
while code[0] == self.__alphabet[0]:
|
||||
code = code[1:]
|
||||
|
||||
return code
|
||||
|
||||
def reset(self:Self, code:str, start:int = 0, length:int = 0) -> str:
|
||||
|
||||
i:int
|
||||
character:str
|
||||
total:int = start + (length or (length := len(code) * self.__base))
|
||||
_from:int|None = -start // self.__base or None
|
||||
_to:int|None = (-total // self.__base) - (1 if total % self.__base else 0) or None
|
||||
hexas:list[int] = []
|
||||
|
||||
if _from:
|
||||
start += _from * self.__base
|
||||
total += _from * self.__base
|
||||
|
||||
for i, character in enumerate(reversed(code[-_to:_from])):
|
||||
|
||||
bit:int = i * self.__base
|
||||
next_bit:int = bit + self.__base
|
||||
|
||||
if bit >= start and next_bit < total:
|
||||
hexas.append(0)
|
||||
continue
|
||||
|
||||
hexa:int = self.__alphabet_map[character]
|
||||
j:int
|
||||
|
||||
for j in range(self.__base):
|
||||
if bit < start:
|
||||
continue
|
||||
if bit >= total:
|
||||
break
|
||||
hexa &= ~(1 << j)
|
||||
bit += 1
|
||||
|
||||
return (
|
||||
(code[:_to] if _to else "") +
|
||||
"".join(self.__alphabet[hexa] for hexa in hexas)[::-1] +
|
||||
(code[_from:] if _from else "")
|
||||
)
|
||||
|
||||
def set(self:Self, code:str, new_code:int|str, start:int = 0, clean_bits:int = 0) -> str:
|
||||
|
||||
|
||||
|
||||
return code
|
||||
|
||||
def validate(self:Self,
|
||||
code:int,
|
||||
map:Sequence[int],
|
||||
|
||||
189
README.md
189
README.md
@ -1,190 +1,3 @@
|
||||
# ErrorsManager
|
||||
|
||||
**ErrorsManager** es una librería que nos permite hacer una gestión de errores mediante códigos de error en base binaria o agrupación de base numérica. La idea es poder trasladar un análisis global de errores entre plataformas de forma simple con el condicionante que ambas plataformas han de conocer estructuralmente el sistema de errores. El propósito de dicho sistema es conseguir un sistema unificado de errores que permita el envío compacto de los mismos evitando un uso innecesario de red.
|
||||
|
||||
# Funcionamiento
|
||||
|
||||
La idea es crear un objeto `ErrorsManager` para gestionar los errores dentro del código y hacer uso de `set`, `has` y `process` para gestionar los errores, aunque de por sí tenga más funcionalidades.
|
||||
|
||||
> **NOTA**: Este manual ordenará los métodos y estructuras conforme su utilidad e importancia fuera del ámbito de la propia librería para uso general.
|
||||
|
||||
## Constructor
|
||||
|
||||
`errors_manager:ErrorsManager = new ErrorsManager(inputs:dict[str, any|null])`
|
||||
|
||||
- **alphabet**: Alfabeto String o Array de Caracteres.
|
||||
- **base**: Entero que representa la máxima base 2 numérica que se usará: 16, 32 o 64, por ejemplo.
|
||||
|
||||
El alfabeto no puede contener caracteres iguales, y si los contiene, se encargará de eliminarlos, reduciendo la posibilidad de base.
|
||||
|
||||
## set
|
||||
|
||||
`error:int = errors_manager.set(from:int, code:int|list[byte]|str, from:int = 0, bits:int = 0)`
|
||||
|
||||
`error:list[byte]= errors_manager.set(from:list[byte], code:int|list[byte]|str, from:int = 0, bits:int = 0)`
|
||||
|
||||
`error:str = errors_manager.set(from:str, code:int|list[byte]|str, from:int = 0, bits:int = 0)`
|
||||
|
||||
1. **error**: Código de error original. Puede ser un String, Array de enteros que representan los Hexas o un entero.
|
||||
2. **code**: Código de error a establecer. Puede ser un String, Array de enteros que representan los Hexas o un entero.
|
||||
3. **from**: Determina si se quiere desplazar `code`. 0 indica que no.
|
||||
4. **bits**: Determina si se pasan a 0 los bits que de `error` desde `from`. 0 indica que no.
|
||||
|
||||
El `from` negativo indica que se cuente desde el final, y el `bits` negativo que se cuente para atrás. Esto se establece desde `ErrorsManager.get_from_bits`.
|
||||
|
||||
Retorna el resultado de la unión de `error` con `code` a partir de las posibles modificaciones de `from` y `bits`.
|
||||
|
||||
## has
|
||||
|
||||
`has:bool = errors_manager.has(code:int|list[byte]|str)`
|
||||
|
||||
Determina si un código de error contiene errores o no.
|
||||
|
||||
## process
|
||||
|
||||
`errors_messages:list[tuple[int, str]] = errors_manager.process(code:int|list[byte]|str, messages:list[str] = [ ... ])`
|
||||
|
||||
Permite recoger el conjunto de mensajes conforme al código de error. Cada mensaje irá acompañado de su Bit de posición, de ahí que retorne una lista de tuplas de un valor entero, que es el Bit de posición; y el String, que es el mensaje en cuestión.
|
||||
|
||||
`[position, message for position:int, message:str in errors_messages]`
|
||||
|
||||
Si retorna una lista vacía es que no hay errores.
|
||||
|
||||
# .NET
|
||||
|
||||
- Docker Hub del SDK: https://hub.docker.com/r/microsoft/dotnet-sdk
|
||||
- Git del SDK: https://github.com/dotnet/sdk
|
||||
|
||||
Para crear los SLN de la Solución:
|
||||
|
||||
```sh
|
||||
#!/bin/bash
|
||||
|
||||
docker exec -it anp-dotnet bash
|
||||
|
||||
cd CSharp
|
||||
dotnet new sln -n ErrorsManager
|
||||
dotnet sln add ErrorsManager.csproj
|
||||
cd ..
|
||||
|
||||
exit
|
||||
|
||||
sudo chown -R root:$USER CSharp/ErrorsManager.slnx
|
||||
|
||||
```
|
||||
|
||||
Luego hay que pelar el archivo de definición de proyecto `ErrorsManager.csproj`:
|
||||
|
||||
```xml
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<!-- <OutputType>Library</OutputType> -->
|
||||
<TargetFrameworks>net10.0;net462</TargetFrameworks>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>ErrorsManager</RootNamespace>
|
||||
<AssemblyName>ErrorsManager</AssemblyName>
|
||||
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ErrorsManager.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Tests.cs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
```
|
||||
|
||||
Instalación del SDK para desarrollo VSCode.
|
||||
|
||||
```sh
|
||||
#!/bin/bash
|
||||
wget https://packages.microsoft.com/config/ubuntu/24.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
|
||||
sudo dpkg -i packages-microsoft-prod.deb
|
||||
rm packages-microsoft-prod.deb
|
||||
sudo apt update
|
||||
sudo apt install -y dotnet-sdk-10.0
|
||||
```
|
||||
|
||||
Luego, instalar el Pluggin Nuget de Visual Studio Code `C/C++ DevTools`.
|
||||
|
||||
Para ejecutar un proyecto .NET desde Docker.
|
||||
|
||||
```sh
|
||||
#!/bin/bash
|
||||
docker exec -it anp-dotnet dotnet run --project /workspace/CSharp/ErrorsManager.csproj -f net10.0
|
||||
```
|
||||
|
||||
Para compilar DLL primero configurar el archivo de definición de proyecto `ErrorsManager.csproj`.
|
||||
|
||||
```xml
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<!-- <OutputType>Exe</OutputType> -->
|
||||
<OutputType>Library</OutputType>
|
||||
<TargetFrameworks>net10.0;net462</TargetFrameworks>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>ErrorsManager</RootNamespace>
|
||||
<AssemblyName>ErrorsManager</AssemblyName>
|
||||
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ErrorsManager.cs" />
|
||||
<!-- <Compile Include="Program.cs" />
|
||||
<Compile Include="Tests.cs" /> -->
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
```
|
||||
|
||||
Y luego ejecutar:
|
||||
|
||||
```sh
|
||||
#!/bin/bash
|
||||
dotnet build ErrorsManager.csproj -c Release
|
||||
```
|
||||
|
||||
# Objetivos
|
||||
|
||||
Leyenda:
|
||||
|
||||
- **Py**: Python
|
||||
- **PHP**
|
||||
- **JS**: JavaScript/ECMAScript
|
||||
- **MSL**: SQLServer/TransactSQL
|
||||
- **MyL**: MySQL/MariaDB
|
||||
- **CS**: C#/CSharp
|
||||
- **VB**: VisualBasic
|
||||
- **Go**: Golang
|
||||
- **RS**: Rust
|
||||
- **C**
|
||||
- **CPP**: C++
|
||||
|
||||
Tabla de objetivos:
|
||||
|
||||
| Objetivo | Py | PHP | JS | MSL | MyS | CS | VB | Go | RS | C | CPP |
|
||||
|-------------------|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
|
||||
| Common base | [X] | [ ] | [X] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] |
|
||||
| set_alphabet | [X] | [ ] | [X] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] |
|
||||
| get_alphabet | [ ] | [ ] | [ ] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] |
|
||||
| to_array | [X] | [ ] | [X] | | | [X] | [ ] | [ ] | [ ] | [ ] | [ ] |
|
||||
| to_integer | [X] | [ ] | [X] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] |
|
||||
| to_string | [X] | [ ] | [X] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] |
|
||||
| to_string_binary | [X] | [ ] | [X] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] |
|
||||
| process | [X] | [ ] | [X] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] |
|
||||
| get_bits | [ ] | [ ] | [ ] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] |
|
||||
| bitwise | [X] | [ ] | [X] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] |
|
||||
| get_from_bits | [ ] | [ ] | [ ] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] |
|
||||
| reset | [X] | [ ] | [X] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] |
|
||||
| get_range | [ ] | [ ] | [ ] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] |
|
||||
| has | [X] | [ ] | [X] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] |
|
||||
| clean | [ ] | [ ] | [ ] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] |
|
||||
| set | [X] | [ ] | [X] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] |
|
||||
|
||||
> **NOTA**: Los Checkbox indican el estado siendo los siguientes:
|
||||
|
||||
- [ ] Sin cubrir, está por hacerse.
|
||||
- [-] Están en desarrollo actualmente.
|
||||
- [X] Ya está hecho y es usable.
|
||||
|
||||
> **NOTA**: Según lenguajes que tenga cierta rigidez, como es el caso de Golang, los nombres de los métodos y atributos pueden cambiar a Camel o Pascal.
|
||||
Errors codes manager for binary errors system, unlocking the 32 bits limit.
|
||||
Loading…
Reference in New Issue
Block a user