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" />
                    
Directory.Packages.props
<PackageReference Include="Kisetsu.Utils" />
                    
Project file
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
                    
#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
                    
Install as a Cake Addin
#tool nuget:?package=Kisetsu.Utils&version=1.0.7
                    
Install as a Cake Tool

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.
  • ๐Ÿ–ฅ๏ธ 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 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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.7 9 7/28/2025
1.0.6 133 6/26/2025
1.0.4 98 6/21/2025
1.0.3 137 6/18/2025

Patch 1.0.7
Feat - Collection Extensions