Yangdong_Toolkit 1.0.5
dotnet add package Yangdong_Toolkit --version 1.0.5
NuGet\Install-Package Yangdong_Toolkit -Version 1.0.5
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="Yangdong_Toolkit" Version="1.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Yangdong_Toolkit" Version="1.0.5" />
<PackageReference Include="Yangdong_Toolkit" />
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 Yangdong_Toolkit --version 1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Yangdong_Toolkit, 1.0.5"
#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 Yangdong_Toolkit@1.0.5
#: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=Yangdong_Toolkit&version=1.0.5
#tool nuget:?package=Yangdong_Toolkit&version=1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
MyNuget 常用工具库
个人常用的 .NET 工具库,包含加解密、字符串处理、数据验证、日期时间、网络请求等常用工具。
📦 安装
dotnet add package MyNuget
🛠️ 工具列表
🔐 Security - 加解密与安全
| 类 | 说明 |
|---|---|
AesHelper |
AES 对称加密,支持 CBC/GCM 模式 |
RsaHelper |
RSA 非对称加密/签名 |
HashHelper |
MD5/SHA/SHA256/SHA512 哈希 |
Base64Helper |
Base64 编解码 |
PasswordHelper |
密码哈希与验证(PBKDF2) |
📝 Text - 字符串处理
| 类 | 说明 |
|---|---|
StringExtensions |
字符串扩展方法(判空、截断、格式化) |
SensitiveMasker |
敏感信息脱敏(手机号、身份证、银行卡) |
RegexHelper |
正则表达式工具 |
✅ Validation - 数据验证
| 类 | 说明 |
|---|---|
ValidationHelper |
邮箱、手机、身份证、URL 等验证 |
📅 Datetime - 日期时间
| 类 | 说明 |
|---|---|
DateTimeHelper |
时间戳、格式化、农历转换 |
🌐 Network - 网络
| 类 | 说明 |
|---|---|
HttpHelper |
HTTP GET/POST 请求封装 |
UrlHelper |
URL 编解码/构建 |
📁 IO - 文件操作
| 类 | 说明 |
|---|---|
FileHelper |
文件读写 |
PathHelper |
路径处理 |
📋 Json - JSON
| 类 | 说明 |
|---|---|
JsonHelper |
JSON 序列化扩展 |
📋 Logging - 日志
| 类 | 说明 |
|---|---|
Logger |
控制台/文件日志 |
📦 Collections - 集合
| 类 | 说明 |
|---|---|
CollectionExtensions |
集合扩展、分页、去重 |
🚀 快速使用
加解密
// 哈希
var hash = HashHelper.ComputeHash("password", HashHelper.HashType.SHA256);
// AES加密
var encrypted = AesHelper.Encrypt("data", key, iv);
// 密码验证
var hash = PasswordHelper.Hash("password");
var isValid = PasswordHelper.Verify("password", hash);
字符串
// 脱敏
var phone = "13812345678".MaskPhone(); // "138****5678"
var id = "110101199001011234".MaskIdCard(); // "110101********1234"
验证
var isEmail = ValidationHelper.IsEmail("test@example.com");
var isPhone = ValidationHelper.IsChinesePhone("13812345678");
var isIdCard = ValidationHelper.IsChineseIdCard("110101199001011234");
HTTP
var json = await HttpHelper.GetAsync("https://api.example.com/data");
var result = await HttpHelper.PostAsync<UserResponse>("https://api.example.com/create", user);
JSON
var json = obj.ToJson();
var obj = json.FromJson<MyClass>();
📋 要求
- .NET 10.0 或更高版本
📄 许可证
MIT License - 详见 LICENSE
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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.
-
net8.0
- Newtonsoft.Json (>= 13.0.3)
-
net9.0
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.