RBytesNetUtil 0.2.3

dotnet add package RBytesNetUtil --version 0.2.3
                    
NuGet\Install-Package RBytesNetUtil -Version 0.2.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RBytesNetUtil" Version="0.2.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RBytesNetUtil" Version="0.2.3" />
                    
Directory.Packages.props
<PackageReference Include="RBytesNetUtil" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RBytesNetUtil --version 0.2.3
                    
#r "nuget: RBytesNetUtil, 0.2.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RBytesNetUtil@0.2.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RBytesNetUtil&version=0.2.3
                    
Install as a Cake Addin
#tool nuget:?package=RBytesNetUtil&version=0.2.3
                    
Install as a Cake Tool

RBytesNetUtil

Biblioteca utilitária para .NET com funções comuns de manipulação de dados, datas, arquivos, ordenações, algoritmos e geração de planilhas Excel simples sem dependências externas.

🚀 Funcionalidades Disponíveis

  • 📊 Geração de arquivos Excel (.xlsx) com estrutura XML pura
  • 🔢 Funções matemáticas (Fatorial, Fibonacci, MMC, MDC...)
  • 🧠 Algoritmos úteis (Busca Binária, Kadane, Palíndromo...)
  • 🔤 Ordenações (Bubble Sort, Quick Sort, Merge Sort...)
  • 📅 Utilitários de data e hora
  • 📦 Manipulação de JSON
  • 🌐 Utilitários de rede

💡 Exemplos de Uso

📊 Excel — Criar um arquivo .xlsx simples

var dados = new List<List<string>>
{
    new() { "Nome", "Idade", "Cidade" },
    new() { "Ana", "30", "São Paulo" },
    new() { "Bruno", "25", "Rio de Janeiro" }
};

RBytesExcelUtil.CriarExcelXLSX("dados.xlsx", "Pessoas", dados);

🔢 Json — Serializar e desserializar objetos

var pessoa = new { Nome = "Carlos", Idade = 28 };
string json = RBytesJsonUtil.ToJson(pessoa);

var novaPessoa = RBytesJsonUtil.FromJson<Dictionary<string, object>>(json);
Console.WriteLine(novaPessoa["Nome"]); // Carlos

🧮 Math — Fatorial, Fibonacci, MMC e MDC

Console.WriteLine(RBytesMathUtil.Fatorial(5));         // 120
Console.WriteLine(RBytesMathUtil.Fibonacci(6));        // 8
Console.WriteLine(RBytesMathUtil.MMC(10, 15));         // 30
Console.WriteLine(RBytesMathUtil.MDC(36, 60));         // 12

📅 DateTime — Datas úteis

Console.WriteLine(RBytesDateTimeUtil.ConverterMesExtensoParaNumerico("01"));          // janeiro
Console.WriteLine(RBytesDateTimeUtil.AppendTimeStamp("arquivo.xls"));     

🔤 Sort — Algoritmos de ordenação

int[] numeros = { 5, 3, 8, 2, 1 };
RBytesSortUtil.BubbleSort(numeros);
Console.WriteLine(string.Join(", ", numeros)); // 1, 2, 3, 5, 8

🔎 Algoritmos — Busca Binária

int[] lista = { 1, 3, 5, 7, 9 };
int index = RBytesAlgoritmoUtil.BuscaBinaria(lista, 5);
Console.WriteLine(index); // 2

📦 Como instalar

# Em seu terminal:
dotnet add package RBytesNetUtil

Ou copie o código do repositório RBytesNetUtil diretamente.

📂 Organização

  • Excel/ExcelUtil.cs
  • Json/JsonUtil.cs
  • Sort/SortUtil.cs
  • Math/MathUtil.cs
  • DateTime/DateTimeUtil.cs
  • Algorithms/AlgoritmoUtil.cs
  • Others/NetworkUtil.cs

RBytesNetUtil

Biblioteca utilitária em .NET focada em produtividade, reutilização de código e simplicidade.

Contém funções comuns para manipulação de arquivos, datas, textos, formatações (CPF, CNPJ, CEP, etc), operações matemáticas e muito mais.


📁 Estrutura do projeto

  • RBytesNetUtil/ — Código-fonte da biblioteca.
  • RBytesNetUtil.Tests/ — Projeto de testes unitários com xUnit.
  • Samples/ — Exemplos práticos de uso.
  • RBytesNetUtil.sln — Solução do Visual Studio / .NET CLI.

🚀 Comandos úteis para desenvolvimento (.NET)

▶️ Executar exemplo (via CLI)

dotnet run --project Samples

🧪 Executar todos os testes

dotnet test

🔧 Compilar a solução

dotnet build MinhaBiblioteca.sln

🧹 Restaurar pacotes e limpar build

dotnet restore

dotnet clean

📦 Adicionar novo pacote NuGet

dotnet add package NomeDoPacote

📄 Atualizar todos os pacotes NuGet (via PowerShell)

Get-Project | ForEach-Object { dotnet list $_.Name package --outdated }

Ou use a interface do Visual Studio para gerenciar pacotes NuGet graficamente.


🆕 Como criar novos projetos no .NET

Esses comandos ajudam a criar novos tipos de projetos e adicioná-los à solução (.sln) existente:

📚 Biblioteca de Classes (Class Library)

Cria um novo projeto de biblioteca com código reutilizável:

dotnet new classlib -n MinhaBiblioteca.Utils
# Adiciona o projeto à solução
dotnet sln MinhaBiblioteca.sln add MinhaBiblioteca.Utils/MinhaBiblioteca.Utils.csproj

🧪 Projeto de Testes com xUnit

Ideal para testar funcionalidades da biblioteca:

dotnet new xunit -n MinhaBiblioteca.Utils.Tests
# Adiciona à solução e cria referência à biblioteca
dotnet sln MinhaBiblioteca.sln add MinhaBiblioteca.Utils.Tests/MinhaBiblioteca.Utils.Tests.csproj
dotnet add MinhaBiblioteca.Utils.Tests reference MinhaBiblioteca.Utils

🌐 API Web (Web API)

Cria um backend simples via HTTP:

dotnet new webapi -n MinhaBiblioteca.Api
# Adiciona à solução
dotnet sln MinhaBiblioteca.sln add MinhaBiblioteca.Api/MinhaBiblioteca.Api.csproj

🖥 Aplicativo de Console (Exemplo)

Útil para demonstrar uso da biblioteca:

dotnet new console -n Samples.ExemploNovo
# Adiciona à solução
dotnet sln MinhaBiblioteca.sln add Samples.ExemploNovo/Samples.ExemploNovo.csproj

💡 Dica: a extensão .sln (solution) organiza vários projetos em um mesmo repositório, facilitando o desenvolvimento e testes conjuntos.


🤝 Contribuição

Pull requests são bem-vindos! Sinta-se à vontade para abrir issues, reportar bugs ou sugerir melhorias. Este projeto visa ser simples e acessível para toda a comunidade .NET.


Por Rodrigo Delphino - github.com/rodrigodelphino

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.3 117 2/28/2026
0.2.0 259 4/23/2025
0.1.0 229 4/23/2025