
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
A Product by UNLEIN® Private Limited for Improve C# Based Application with Ready to use Methods that are Allowed for Generating Hash Values with One Way/Two Way. Also You can Manage Logging, Get Your Completed file details with Base64 Data and with our Package. 1. Generating One Way Hash Values 2. Generate Two Ways Hash Values - With Key for Manage Encryption/Decryption 3. Generating Hash Value when user Subscribe Email and need create unsubscribe one way token 4. Getting All Details of file before Upload 5. Getting Base64String data of file with fileinfo and befor file upload 6. Easy and Quick Upload file with Real Time rename feature with dynamic return. 7. Replace method with SafeReplace method for Find and Replace Exact value and no others. 8. Shuffle characters string 9. Upload base64 string file 10. Cookie Manager for Get/Save/Update/Delete Cookie From Code 11. Between String Extension Added 12. Now Make Database Connections for Retrive fast data - Optimized and fastest way for database calling - Return data in DataSet and DataTables - Global DataBase Connection String - Call SP with Direct inline queries - Passing Complex DataTypes like [tables] in Sql Server - Insert Method Added in DB - Query dynamic Mapping - Query List for dynamic list Mapping 13. Added Logging functionality. It is easy to set up, has a clean API, and runs on all .NET platforms above 6.0. While it's useful even in the simplest applications, it's much lightweight and very simple to use, also manage log files with "Rolling Interval" functionality. 14. Api Callings Added, Now you don't need to write Api Calling code every time, just use most optimized, fast, very easy to use with auto logging feature of api callings, prebuilt methods, advanced response caching and more from unlein.Utilities. 15. Mathematical Operations 16. Validations - DateTime Extensions - Data Validation 17. Collection Operations Product is Developed and Maintained by UNLEIN® Private Limited.
The UNLEIN® Utilities package is a comprehensive collection of ready-to-use methods designed to improve your C# applications. It simplifies tasks like generating hash values (both one-way and two-way), managing logging, handling file uploads, making API calls, and performing database operations. Whether you're building a simple app or a complex enterprise system, this package offers optimized, easy-to-use solutions.
.NET
platforms above version 6.0.Program is Developed and Maintained By UNLEIN® Private Limited
using UNLEIN.Utilities;
// URL Slug Generation
"Hello World! This is a test".ToSlug(); // "hello-world-this-is-a-test"
// Secure Random String
var randomString = DeveloperUtilities.GenerateRandomString(10); // e.g., "aX9#mK2$pL"
// Smart Text Truncation
"This is a very long text".TruncateWithEllipsis(10); // "This is..."
// Extract Numbers
"Product123ABC456".ExtractNumbers(); // "123456"
// File Size Formatting
(1234567L).FormatFileSize(); // "1.18 MB"
// Case Conversion
"thisIsATest".ToSentenceCase(); // "This is a test"
// Duration Formatting
TimeSpan.FromMinutes(45).ToReadableDuration(); // "45 minutes"
// Safe Enum Parsing
"DRAFT".ParseEnum(Status.Pending); // Returns Status.DRAFT or Status.Pending if invalid
// HTML Stripping
"<p>Hello <b>World</b></p>".StripHtml(); // "Hello World"
// String Masking
"1234567890".Mask(4); // "******7890"
// JSON Validation
"{\"name\":\"test\"}".IsValidJson(); // true
// Get Initials
"John Doe".GetInitials(); // "JD"
using UNLEIN.Utilities;
// Statistical Analysis
var numbers = new[] { 1.0, 2.0, 3.0, 4.0, 5.0 };
double stdDev = numbers.StandardDeviation();
var movingAvgs = numbers.MovingAverage(3).ToList();
var ema = numbers.ExponentialMovingAverage(3).ToList();
// Number Theory
bool isPrime = 17L.IsPrime(); // true
long gcd = 48L.GCD(18L); // 6
long lcm = 12L.LCM(18L); // 36
// Advanced Calculations
double cubeRoot = 27.0.NthRoot(3); // 3.0
double interpolated = 0.0.Lerp(100.0, 0.5); // 50.0
// Combinatorics
long combinations = 5.Combinations(2); // 10
var fibSequence = 10.Fibonacci().ToList();
using UNLEIN.Utilities;
var date = DateTime.Now;
var weekStart = date.StartOfWeek();
var monthEnd = date.EndOfMonth();
var timeAgo = date.AddDays(-5).ToTimeAgo(); // "5 days ago"
var nextWorkday = date.NextBusinessDay();
using UNLEIN.Utilities;
"123-456-7890".IsValidPhoneNumber(); // true
"4532015112830366".IsValidCreditCard(); // true
"https://example.com".IsValidUrl(); // true
"192.168.1.1".IsValidIPv4(); // true
"Password123!".IsStrongPassword(); // true
using UNLEIN.Utilities;
var numbers = Enumerable.Range(1, 10);
// Chunk large collections
var chunks = numbers.Chunk(3); // [[1,2,3], [4,5,6], [7,8,9], [10]]
// Get random element
var randomNumber = numbers.Random();
// Check uniqueness
var hasUnique = numbers.AllUnique(); // true
// Shuffle collection
var shuffled = numbers.Shuffle();
// Get slice of collection
var slice = numbers.Slice(2, 5); // [3,4,5]
// Group by frequency
var chars = "hello world".ToCharArray();
var frequency = chars.GroupByFrequency(c => c);
To start using the logging functionality, include the UNLEIN.Utilities.Log
namespace and configure your logger:
using UNLEIN.Utilities.Log;
var logger = new LoggingConfig()
.WriteFile("logs/log.txt", RollingInterval.Hour)
.Start();
Log.Info("Hey");
//Api Callings
var get = await Api.GetAsync("todos/1");
var post = await Api.PostAsync("posts", data);
//You can also use PUT, PATCH, and DELETE requests in the same way.
//To enable API logging, configure the following
//Auto Logging for API
Api.ApiLog.IsApiLog = true;
Api.ApiLog.IncBaseUrl = true;
Api.ApiLog.IncRequest = true;
Api.ApiLog.FilePath = "logs/apilog.txt";
Api._BaseUrl = "https://example.com/";
using UNLEIN.Utilities.Api;
// Configure the API client (do this once at startup)
ApiClient.Configure(config =>
{
config.BaseUrl = "https://api.example.com";
config.DefaultToken = "your-default-token";
config.TimeoutSeconds = 30;
config.EnableCache = true;
config.DefaultCacheSeconds = 300;
config.EnableLogging = true;
});
// GET requests with automatic deserialization
var response = await ApiClient.GetAsync<UserModel>("users/1");
if (response.IsSuccessful)
{
var user = response.Data;
Console.WriteLine($"User: {user.Name}");
}
// GET with query parameters
var searchResponse = await ApiClient.GetListAsync<UserModel>("users", new
{
page = 1,
pageSize = 10,
search = "john"
});
// POST with custom options
var createResponse = await ApiClient.PostAsync<UserModel>(
"users",
new { name = "John", email = "john@example.com" },
new RequestOptions
{
Token = "custom-token",
Headers = new Dictionary<string, string>
{
["Custom-Header"] = "Value"
}
}
);
// File upload
using var formData = new MultipartFormDataContent();
formData.Add(new StreamContent(File.OpenRead("file.pdf")), "file", "file.pdf");
var uploadResponse = await ApiClient.PostFormAsync<FileUploadResponse>(
"upload",
formData
);
// Download file
using var fileStream = await ApiClient.GetFileAsync("files/download/123");
await using var outputStream = File.Create("downloaded.pdf");
await fileStream.CopyToAsync(outputStream);
// PUT request
var updateResponse = await ApiClient.PutAsync<UserModel>(
"users/1",
new { name = "Updated Name" }
);
// DELETE request
var deleteResponse = await ApiClient.DeleteAsync<object>("users/1");
// Handling errors
try
{
var response = await ApiClient.GetAsync<UserModel>(
"users/999",
options: new RequestOptions { ThrowOnError = true }
);
}
catch (ApiException ex)
{
Console.WriteLine($"API error {ex.StatusCode}: {ex.Message}");
}
The enhanced API client provides:
using UNLEIN.Utilities.Database;
// Initialize connection
DbExtensions.Initialize("your_connection_string");
// Simple typed query
var users = await DbExtensions.QueryAsync<User>("SELECT * FROM Users WHERE Age > @Age",
new { Age = 18 });
// Dynamic query with flexible properties
var results = await DbExtensions.QueryDynamicAsync(
"SELECT FirstName, LastName, Email FROM Users");
foreach (dynamic user in results)
{
Console.WriteLine($"{user.FirstName} {user.LastName}");
}
// Stored procedure with output parameters
public class UserParams
{
public int UserId { get; set; }
[ParameterDirection(ParameterDirection.Output)]
public string Status { get; set; }
}
var (users, outputs) = await DbExtensions.ExecuteStoredProcAsync<User>(
"GetUserDetails",
new UserParams { UserId = 1 }
);
Console.WriteLine($"Status: {outputs["@Status"]}");
// Bulk insert
var newUsers = new List<User> { /* ... */ };
await DbExtensions.BulkInsertAsync("Users", newUsers);
// Multiple result sets
using (var results = await DbExtensions.QueryMultipleAsync(@"
SELECT * FROM Users;
SELECT * FROM Orders;"))
{
var users = results.Read<User>();
var orders = results.Read<Order>();
}
The new database extensions provide:
FAQs
A Product by UNLEIN® Private Limited for Improve C# Based Application with Ready to use Methods that are Allowed for Generating Hash Values with One Way/Two Way. Also You can Manage Logging, Get Your Completed file details with Base64 Data and with our Package. 1. Generating One Way Hash Values 2. Generate Two Ways Hash Values - With Key for Manage Encryption/Decryption 3. Generating Hash Value when user Subscribe Email and need create unsubscribe one way token 4. Getting All Details of file before Upload 5. Getting Base64String data of file with fileinfo and befor file upload 6. Easy and Quick Upload file with Real Time rename feature with dynamic return. 7. Replace method with SafeReplace method for Find and Replace Exact value and no others. 8. Shuffle characters string 9. Upload base64 string file 10. Cookie Manager for Get/Save/Update/Delete Cookie From Code 11. Between String Extension Added 12. Now Make Database Connections for Retrive fast data - Optimized and fastest way for database calling - Return data in DataSet and DataTables - Global DataBase Connection String - Call SP with Direct inline queries - Passing Complex DataTypes like [tables] in Sql Server - Insert Method Added in DB - Query dynamic Mapping - Query List for dynamic list Mapping 13. Added Logging functionality. It is easy to set up, has a clean API, and runs on all .NET platforms above 6.0. While it's useful even in the simplest applications, it's much lightweight and very simple to use, also manage log files with "Rolling Interval" functionality. 14. Api Callings Added, Now you don't need to write Api Calling code every time, just use most optimized, fast, very easy to use with auto logging feature of api callings, prebuilt methods, advanced response caching and more from unlein.Utilities. 15. Mathematical Operations 16. Validations - DateTime Extensions - Data Validation 17. Collection Operations Product is Developed and Maintained by UNLEIN® Private Limited.
We found that unlein.utilities demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.