Coder Social home page Coder Social logo

sharp-dev-lib's Introduction

sharp-dev-lib

介绍

sharp-dev-lib是c#中经常用到的工具库,基本都采用扩展的方式,方便客户端调用。

依赖说明

sharp-dev-lib使用.netstandard2.1框架,依赖第三方库如下:

  • Newtonsoft.Json (>= 13.0.1) 用于对序列化及对json格式美化

  • SixLabors.Fonts (>= 1.0.0-beta17)

  • SixLabors.ImageSharp.Drawing (>= 1.0.0-beta14) 用于画验证码

  • DotNetZip (>= 1.16.0) 用于文件压缩

  • SharpCompress (>= 0.31.0) 用于文件解压

安装教程

  1. 从nuget包管理器中搜索安装SharpDevLib

  2. 在Package Manager中执行命令

Install-Package SharpDevLib -Version 1.1.0
  1. 在dotnet cli中执行命令
dotnet add package SharpDevLib --version 1.1.0

使用说明

如果我们想对一个字符串进行md5 hash,代码示例如下:

//using SharpDevLib;
 public void Md5Test()
 {
    var sampleString="HelloWorld";
    var md5Hash=sampleString.MD5Hash();
    Console.WriteLine(md5Hash);
 }

 //结果:68e109f0f40ca72a15e05cc22786f8e6

sharp-dev-lib包含如下表格的工具

名称 描述 使用
CloneUtil 提供对象的深克隆扩展方法 扩展方法
ConvertUtil 提供格式转换的扩展方法(string转Guid,Boolean) 扩展方法
EncodeUtil 提供Base64,Url,Base64Url的编码和解码扩展方法 扩展方法
EnumerableUtil 提供集合中对对象去重的扩展方法 扩展方法
EnumUtil 提供枚举的取值和转换的扩展方法 扩展方法
HashUtil 提供常用Hash以及文件的扩展方法 扩展方法
JsonUtil 提供Json序列化和反序列化及美化的扩展方法 扩展方法
NullCheckUtil 提供对象的空引用和空值断言的扩展方法 扩展方法
ReflectionUtil 提供对象的类型名称以及确保对象是否包含公有无参构造函数的扩展方法 扩展方法
TimeUtil 提供时间的UTC时间戳转换和输出格式的扩展方法 扩展方法
TreeUtil 提供树形结构构建的扩展方法 实现ITreeNode接口,且在对象集合上使用扩展方法
UrlUtil 提供路径合并的扩展方法 扩展方法
VerifyCodeUtil 提供验证码的生成和保存为图片的扩展方法 扩展方法
ZipUtil 文件的压缩和解压扩展方法 扩展方法
FileUtil 文件保存扩展方法 扩展方法
StringUtil Trim扩展方法 扩展方法

版本说明

时间 版本 描述
2024-04-29 v1.1.0 添加StringUtil,清理了代码
2022-07-09 v1.0.5 VerifyCodeUtil依赖库由"System.Drawing.Common"变更为"SixLabors.ImageSharp"
2022-05-19 v1.0.4 HashUtil中GetHexString方法重命名为ToHexString,增加FromHexString方法
2022-05-13 v1.0.3 增加1个工具(FileUtil)
2022-05-09 v1.0.2 ConvertUtil工具移除list和DataTable的转换,转换将在SharpDevLib.Transport包中体现
2022-04-10 v1.0.1 增加1个工具(ZipUtil),添加nuget打包的注释
2022-04-08 v1.0.0 初始化13个工具(CloneUtil,ConvertUtil,EncodeUtil,EnumerableUtil,EnumUtil,HashUtil,JsonUtil,NullCheckUtil,ReflectionUtil,TimeUtil,TreeUtil,UrlUtil,VerifyCodeUtil)

sharp-dev-lib's People

Contributors

yibei333 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.