Kisetsu.Utils
1.0.7
dotnet add package Kisetsu.Utils --version 1.0.7
NuGet\Install-Package Kisetsu.Utils -Version 1.0.7
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="Kisetsu.Utils" Version="1.0.7" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Kisetsu.Utils" Version="1.0.7" />
<PackageReference Include="Kisetsu.Utils" />
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 Kisetsu.Utils --version 1.0.7
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Kisetsu.Utils, 1.0.7"
#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 Kisetsu.Utils@1.0.7
#: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=Kisetsu.Utils&version=1.0.7
#tool nuget:?package=Kisetsu.Utils&version=1.0.7
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Kisetsu.Utils
A lightweight and modular C# utility library offering common helper functions for console interaction, hashing, string manipulation, AES encryption / decryption, collection extensions and JSON file operations.
๐ฆ Features
๐ StringExtensions
- Flexible character stripping by mode or character set.
- Supports removal of substrings, alphanumerics, symbols, and whitespace.
๐ AES
- Provides AES encryption and decryption utilities using a passphrase and salt.
- Generates a cryptographically secure random salt.
๐งฎ Hash
- SHA-1, SHA-256, and SHA-512 hashing for any string and stream input.
- Outputs string or byte array with exception handing.
๐ Json
- Load and save JSON files to/from
Dictionary<string, T>
using Newtonsoft.Json. - Auto-creates directories on save.
- Load and save JSON files to/from
๐ฅ๏ธ Terminal
- Colored console input/output utilities.
- Type-safe generic
Input<T>()
parsing. Log()
with timestamp, file, method, and line number using[CallerInfo]
.
๐ CollectionsExtensions
- Random element from collections.
- Printable collections
๐งฐ Requirements
- .NET 6.0 or later
- Newtonsoft.Json package
Install via NuGet:
dotnet add package Newtonsoft.Json
๐ Quick Start
using Kisetsu.Utils;
// Strip unwanted characters
string clean = "Hello, World!".Strip(StripMode.Alphanumeric); // => "HelloWorld"
// Compute hash
string sha1 = Hash.Compute("password123", Algorithm.SHA1);
// JSON I/O
var data = Json.Load<int>("settings.json");
Json.Save("backup.json", data);
// Colored log
Terminal.Log("Initialized successfully");
// Print collection
List<string> names = [ "John", "Sam", "Jenny"];
Terminal.WriteLine(names.All)
// AES encryption/decryption
var salt = AES.GenerateSalt();
string encrypted = AES.Encrypt("Hello World","mySecretPassphrase", salt);
string decrypted = AES.Decrypt(encrypted, "mySecretPassphrase");
๐ง StripMode Reference
Mode | Behavior |
---|---|
None |
Returns input unchanged |
Whitespace |
Removes spaces, tabs, and line breaks |
Alphanumeric |
Keeps letters and digits only |
Alphabets |
Keeps letters only |
Numeric |
Keeps digits only |
Symbols |
Keeps punctuation/symbols only |
๐งช Logging Example
Terminal.Log("Something happened!");
Output:
[12:45:32 :: Program.cs :: Main() :: Line 24] Something happened!
๐ Project Structure
Kisetsu.Utils/
โโโ Hash.cs
โโโ Json.cs
โโโ StringExtensions.cs
โโโ CollectionExtensions.cs
โโโ AES.cs
โโโ Terminal.cs
๐ License
MIT License.
โจ Author
Kisetsu (Dharshik)
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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.
-
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.
Patch 1.0.7
Feat - Collection Extensions