Smart.Helper
3.1.0
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.
paket add Smart.Helper --version 3.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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.
// Install Smart.Helper as a Cake Addin #addin nuget:?package=Smart.Helper&version=3.1.0 // Install Smart.Helper as a Cake Tool #tool nuget:?package=Smart.Helper&version=3.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Smart.Helper
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 | Versions 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. |
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
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 |
---|---|---|
3.1.0 | 22 | 2/22/2025 |
3.0.1 | 69 | 2/15/2025 |
3.0.0 | 90 | 1/3/2025 |
2.1.0 | 102 | 12/7/2024 |
2.0.2411.26 | 83 | 11/26/2024 |
2.0.2410.31 | 92 | 10/31/2024 |
2.0.2410.27 | 95 | 10/27/2024 |
2.0.2410.24 | 93 | 10/24/2024 |
2.0.2410.22 | 85 | 10/22/2024 |
2.0.2410.13 | 98 | 10/13/2024 |
1.0.2409.2401 | 123 | 9/24/2024 |
1.0.2409.24 | 98 | 9/24/2024 |
1.0.2406.17 | 139 | 6/16/2024 |
1.0.2406.16 | 120 | 6/16/2024 |
1.0.2311.601 | 224 | 11/6/2023 |
1.0.2311.17 | 141 | 11/17/2023 |
1.0.2311.6 | 137 | 11/6/2023 |
1.0.2310.23 | 153 | 10/23/2023 |
1.0.2308.29 | 155 | 8/29/2023 |
1.0.2308.19 | 155 | 8/19/2023 |
1.0.2308.2 | 177 | 8/5/2023 |
1.0.2308.1 | 177 | 8/5/2023 |