Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 10, 2025

  • Replace existing README.md content with new comprehensive Chinese documentation
  • Verify the change doesn't affect build system
  • Commit the updated README.md

Successfully replaced the minimal README.md file with comprehensive Chinese documentation that includes:

  • Project introduction and description
  • Main features overview (caching, arrays, hashing, temporary files, thread locking, string compression)
  • Installation instructions via NuGet and git clone
  • Code examples demonstrating usage
  • License information
  • Contribution guidelines
  • Contact information

The change is minimal and surgical - only replacing the content of README.md without affecting any other files or the build system.

This pull request was created as a result of the following prompt from Copilot chat.

将现有 README.md 文件替换为最新内容,内容如下:

LuYao .NET 通用工具库

MIT License
NuGet

简介

luyao-dotnet 是一个高质量、易用的 .NET 工具库,提供丰富的通用工具类和扩展方法,涵盖缓存、哈希、数组、线程锁、临时文件、字符串压缩等常用开发场景,助力 .NET 开发者提升开发效率与代码质量。

主要功能

  • 缓存对象CachedObject<T> 支持缓存值及多种过期策略。
  • 数组工具Arrays 类便捷获取指定类型的空数组。
  • 哈希算法HashAgent/HashAgents 支持 CRC32、CRC64、MD5、SHA1 等常用哈希算法。
  • 临时文件管理AutoCleanTempFile 对象自动清理临时文件,避免资源泄露。
  • 线程锁机制KeyedLocker<T> 实现基于 Key 的高并发锁。
  • 字符串压缩/解压LzStringGZipString 支持多种字符串压缩与解压缩算法。

安装

推荐通过 NuGet 安装:

dotnet add package LuYao.Common

或访问 NuGet 官网 获取最新信息。

也可通过源码集成到你的 .NET 项目中:

git clone https://github.com/coderbusy/luyao-dotnet.git

示例

// 缓存对象的使用
var cache = new CachedObject<string>("Hello", TimeSpan.FromMinutes(5));
Console.WriteLine(cache.Value);

// 获取空数组
var emptyInts = Arrays.Empty<int>();

// 计算文件的 MD5
var md5 = HashAgents.MD5.HashFile("test.txt");

// 创建自动清理的临时文件
using var tempFile = new AutoCleanTempFile();
File.WriteAllText(tempFile.FileName, "临时数据");

// 线程锁机制
var lockObj = KeyedLocker<string>.GetLock("my-key");
lock (lockObj)
{
    // 临界区代码
}

授权协议

本项目基于 MIT License 开源,欢迎自由使用与贡献。


贡献

欢迎提交 Issue 和 PR。


联系

GitHub: coderbusy/luyao-dotnet
NuGet: LuYao.Common


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants