Smart.Helper 3.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Smart.Helper --version 3.1.0
                    
NuGet\Install-Package Smart.Helper -Version 3.1.0
                    
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="Smart.Helper" Version="3.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Smart.Helper" Version="3.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Smart.Helper" />
                    
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 Smart.Helper --version 3.1.0
                    
#r "nuget: Smart.Helper, 3.1.0"
                    
#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 Smart.Helper@3.1.0
                    
#: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=Smart.Helper&version=3.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Smart.Helper&version=3.1.0
                    
Install as a Cake Tool

Smart.Helper

NuGet
Smart.Helper 是一个支持 .NET 6/8/9 的实用工具库,提供高效的数据类型转换功能,有两个类可供使用,分别为SmartConvert和SmartByteBuffer。

使用示例

csharp
// 进制转换
var binary = SmartConvert.ConvertBase("255", 10, 2); // 返回 "11111111"

// 字节数组转十六进制
var hex = SmartConvert.ByteArrayToHexArray(new byte[] {0xA1, 0xB2}, true); // 返回 "A1 B2"

// ASCII转换
var str = SmartConvert.ASCIIStringToVisibleString("303132"); // 返回 "012"

// 计算modbus协议CRC
byte[] testData = [0x01, 0x03, 0x00, 0x13, 0x00, 0x01];
byte[] crc1 = SmartCRC16.ModbusCRC_LoHi(testData);

// SmartByteBuffer
short s1 = 15000;
int i1 = 1000001;
long l1 = 10000000001;
SmartByteBuffer buffer1 = new(100);
buffer1.SetInt16(s1);
Assert.Equal(s1, buffer1.GetInt16());
buffer1.SetInt32(i1);
Assert.Equal(i1, buffer1.GetInt32());
buffer1.SetInt64(l1);
Assert.Equal(l1, buffer1.GetInt64());

Developed by zenglei

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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.
  • net6.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Smart.Helper:

Package Downloads
Smart.Modbus

Modbus协议封装库,提供ModbusRTU、ModbusTCP和ModbusASCII的组帧、响应校验、响应解析、数据缓冲,不涉及通信;分为ModbusMaster和ModbusSlave,分别用于Modbus主站和从站

Smart.Ports

Smart.Ports是一个统一的通信端口类库,提供了一致的接口来操作不同类型的通信端口,包括串口(SerialPort)、TCP客户端(TcpClient)、TCP服务端(TcpServer)和UDP节点(Udp)。该类库使用工厂模式简化端口创建,并通过继承关系提供特定端口类型的扩展功能。 Smart.Ports is a unified communication port library that provides a consistent interface for operating different types of communication ports, including SerialPort, TcpClient, TcpServer, and Udp. The library uses the factory pattern to simplify port creation and provides extended functionality for specific port types through inheritance.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.4.4 168 10/15/2025
3.4.3 233 9/3/2025
3.4.2 268 7/20/2025
3.4.1 100 7/19/2025
3.4.0 193 7/13/2025
3.3.3 186 7/10/2025
3.3.2 369 6/8/2025
3.3.1 182 6/1/2025
3.3.0 145 6/1/2025
3.2.0 249 5/7/2025
3.1.2 146 2/28/2025
3.1.1 170 2/26/2025
3.1.0 168 2/22/2025
3.0.1 169 2/15/2025
3.0.0 182 1/3/2025
2.1.0 164 12/7/2024
2.0.2411.26 140 11/26/2024
2.0.2410.31 162 10/31/2024
2.0.2410.27 153 10/27/2024
2.0.2410.24 168 10/24/2024
2.0.2410.22 146 10/22/2024
2.0.2410.13 178 10/13/2024
1.0.2409.2401 201 9/24/2024
1.0.2409.24 162 9/24/2024
1.0.2406.17 202 6/16/2024
1.0.2406.16 175 6/16/2024
1.0.2311.601 260 11/6/2023
1.0.2311.17 181 11/17/2023
1.0.2311.6 190 11/6/2023
1.0.2310.23 194 10/23/2023
1.0.2308.29 218 8/29/2023
1.0.2308.19 242 8/19/2023
1.0.2308.2 245 8/5/2023
1.0.2308.1 245 8/5/2023