STTech.CodePlus
1.7.6.1
.NET 8.0
This package targets .NET 8.0. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
.NET Framework 4.5
This package targets .NET Framework 4.5. The package is compatible with this framework or higher.
dotnet add package STTech.CodePlus --version 1.7.6.1
NuGet\Install-Package STTech.CodePlus -Version 1.7.6.1
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="STTech.CodePlus" Version="1.7.6.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="STTech.CodePlus" Version="1.7.6.1" />
<PackageReference Include="STTech.CodePlus" />
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 STTech.CodePlus --version 1.7.6.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: STTech.CodePlus, 1.7.6.1"
#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 STTech.CodePlus@1.7.6.1
#: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=STTech.CodePlus&version=1.7.6.1
#tool nuget:?package=STTech.CodePlus&version=1.7.6.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
STTech.CodePlus
STTech.CodePlus 是一个功能强大、高频实用的 .NET 基础类库与语法扩展库。为日常开发中高频接触的基础类型(String、Array、Collections、Byte、DateTime、Enum、Task、Reflection 等)提供了大量现代化、高效便捷的扩展方法,并内置了聚类分析、几何算法、压缩算法等实用工具。
🌟 核心特性
- 🛠 高频类型扩展:
Byte[]/Span<byte>:十六进制互转 (ToHexString/GetBytesFromHexString)、CRC16/32 计算、结构体与字节数组序列化。String:字符串安全截取、正则匹配、编码转换、MD5/SHA 计算。IEnumerable<T>/List<T>:批量拆分 (Chunk)、打乱 (Shuffle)、去重投影、非空过滤。DateTime:Unix 时间戳互转、季度/周计算、时间区间重叠判断。
- 📊 智能算法集成:
- 聚类算法:K-Means (
KMeansCluster)、DBSCAN (DBScanCluster)。 - 几何与平滑算法:凸包检测 (
ConvexHull)、Chaikin 曲线平滑 (Chaikin)、线性回归拟合 (RegressionLine)。 - 字符串匹配:KMP 字符串模式匹配。
- 聚类算法:K-Means (
- 🧵 并发与异步工具:轻量级任务队列、安全事件触发器 (
EventInvoker)、线程安全缓存。
📦 安装
通过 NuGet 命令行安装:
dotnet add package STTech.CodePlus
🚀 快速上手
1. 字节与十六进制处理
using STTech.CodePlus;
byte[] data = new byte[] { 0x01, 0x0A, 0xFF };
// 转换为十六进制字符串: "01 0A FF"
string hex = data.ToHexString();
// 十六进制字符串转回字节数组
byte[] parsed = "01 0A FF".GetBytesFromHexString();
2. 几何与聚类算法示例
using STTech.CodePlus.Algorithm.Clusters;
using STTech.CodePlus.Algorithm;
// 准备一组二维点
var points = new Point[]
{
new(1, 1), new(1, 2), new(2, 1),
new(10, 10), new(10, 11), new(11, 10)
};
// 执行 KMeans 聚类(分成 2 个簇)
var cluster = new KMeansCluster(k: 2);
var result = cluster.Cluster(points);
📄 开源许可证
本项目基于 Apache-2.0 协议开源。
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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 was computed. 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 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.5
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages (22)
Showing the top 5 NuGet packages that depend on STTech.CodePlus:
| Package | Downloads |
|---|---|
|
STTech.BytesIO.Core
通信核心库,提供基于字节数组通信的标准接口;内置协议解包器等组件;提供异步通信、同步通信、心跳发送、心跳检测、自动重连等众多实用的扩展功能。 |
|
|
STTech.BytesIO.Tcp
BytesIO TCP通信库,提供通信事件、异步通信、同步通信等功能。支持SSL/TLS通信。 |
|
|
STTech.BytesIO.Serial
BytesIO 串口通信库,提供通信事件、异步通信、同步通信等功能。 |
|
|
ApeFree.ApeForms.Core
WinForm窗体核心库,包含功能丰富的控件(Metro风格),为常用控件提供扩展功能,更多的使用方法请参考项目URL。 |
|
|
STTech.BytesIO.Udp
BytesIO Udp通信库,提供UDP单播、广播、多播以及UDP数据包接收功能。 |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.7.6.1 | 52 | 9/6/2026 |
| 1.7.6 | 177 | 8/28/2026 |
| 1.7.5.3 | 173 | 7/29/2026 |
| 1.7.5.2 | 437 | 3/23/2026 |
| 1.7.5.1 | 669 | 11/6/2025 |
| 1.7.5 | 464 | 11/4/2025 |
| 1.7.4 | 606 | 10/21/2025 |
| 1.7.3.2 | 1,037 | 7/1/2025 |
| 1.7.3.1 | 481 | 6/13/2025 |
| 1.7.2.8 | 571 | 3/30/2025 |
| 1.7.2.7 | 1,576 | 3/21/2025 |
| 1.7.2.6 | 299 | 3/14/2025 |
| 1.7.2.5 | 376 | 2/28/2025 |
| 1.7.2.4 | 885 | 12/23/2024 |
| 1.7.2.3 | 512 | 12/6/2024 |
| 1.7.2.2 | 428 | 11/2/2024 |
| 1.7.2.1 | 1,697 | 4/22/2024 |
| 1.7.2 | 671 | 4/22/2024 |
| 1.6.5.1 | 4,405 | 1/7/2024 |
| 1.6.5 | 5,756 | 12/22/2023 |
Loading failed