
Research
/Security News
Malicious npm Packages Target WhatsApp Developers with Remote Kill Switch
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Softalleys.Utilities
Advanced tools
A collection of utility classes featuring OData extensions, GeoJson converters for NetTopologySuite and Microsoft.Spatial, geographical property filters for OData, custom formatters (CSV, CBOR, YAML), and dependency injection for AuthSessionService.
A comprehensive collection of utility classes, extension methods, and validation attributes for .NET applications.
dotnet add package Softalleys.Utilities
A builder for constructing and manipulating query strings or URI fragment parts.
// Create a new parameters builder
var builder = new ParametersBuilder();
// Add parameters
builder["key"] = "value";
// Convert to string
string queryString = builder.ToString(); // "key=value"
A wrapper around System.UriBuilder
with enhanced functionality for URI manipulation, specifically for handling query strings and fragments.
// Create a builder from a URI string
var builder = new UriBuilderWithQuery("https://example.com");
// Add query parameters
builder.Query["key"] = "value";
// Add fragment parameters
builder.Fragment["section"] = "details";
// Get the resulting URI
Uri result = builder.Uri; // https://example.com?key=value#section=details
Methods for working with object references.
// Check if an object is null
if (myObject.IsNull())
// Throw exception if null
var notNullObject = myObject.NotNull("myObject");
Methods for enhancing string functionality.
// Insert text after a specific fragment
string result = "Hello world".InsertAfter("Hello ", "beautiful ");
// Convert string to GUID
Guid guid = "c2d06c59-9b9e-4e2a-b9d6-d9822937c8c4".ToGuid();
// Check if string is a valid GUID
bool isGuid = "c2d06c59-9b9e-4e2a-b9d6-d9822937c8c4".IsGuid();
// Check if string has a value (not null or empty)
if (myString.HasValue())
// Ensure a string is not null or empty
string value = myString.NotNullOrEmpty("myString");
Provides methods for encoding and decoding data using Base32 and Base32Hex encoding schemes.
// Encode data to Base32
string encoded = Base32.Encode(byteArray);
// Encode data to Base32Hex
string hexEncoded = Base32.EncodeHex(byteArray);
// Decode from Base32
byte[] decoded = Base32.Decode(encodedString);
// Decode from Base32Hex
byte[] hexDecoded = Base32.DecodeHex(hexEncodedString);
Methods for converting between byte arrays and Base64 strings.
// Convert bytes to Base64
string base64 = byteArray.ToBase64();
// Convert Base64 to bytes
byte[] bytes = base64String.FromBase64();
// Create a Base64 data URL for images
string dataUrl = imageBytes.ToBase64Image("image/png");
Secure random number generation utilities.
// Generate random bytes
byte[] randomBytes = CryptoRandom.GetRandomBytes(16);
// Generate a random string
string randomString = CryptoRandom.GetRandomString(32);
// Generate a random string with special characters
string randomWithSpecial = CryptoRandom.GetRandomString(32, true);
Methods for working with enumerable collections.
// Get collection or empty if null
var items = myCollection.OrEmpty();
// Traverse up a hierarchy
var ancestors = node.TraverseUpwards(n => n.Parent);
// Flatten a hierarchy
var allNodes = rootNode.FlattenHierarchy(n => n.Children);
Methods for working with enumerations.
// Convert enum values to snake_case strings
var snakeCaseValues = myEnum.ToSnakeCaseStrings();
Methods for converting between byte arrays and hexadecimal strings.
// Convert bytes to hexadecimal
string hex = byteArray.ToHexadecimalString();
// Convert hexadecimal to bytes
byte[] bytes = hexString.FromHexadecimalString();
// Convert numeric values to hexadecimal
string hexInt = HexadecimalConverter.ToHexadecimalString(42);
Methods for encoding and decoding URL tokens.
// Encode bytes as a URL token
string token = HttpServerUtility.UrlTokenEncode(byteArray);
// Decode URL token to bytes
byte[] bytes = HttpServerUtility.UrlTokenDecode(token);
Extensions for Blazor's NavigationManager.
// Get a query parameter value
string value = navigationManager.GetQueryValue("paramName");
Extensions for working with validation contexts.
// Get the display name for a validation context
string name = validationContext.GetName();
Validates that a property, field, or parameter is an absolute URI.
public class MyModel
{
[AbsoluteUri]
public string Website { get; set; }
[AbsoluteUri(RequireScheme = "https")]
public string SecureWebsite { get; set; }
}
Validates that a date value is before a specified date.
public class Person
{
[BeforeAt("now -18y")] // Must be at least 18 years ago
public DateTimeOffset BirthDate { get; set; }
[BeforeAt("2030-01-01")] // Must be before fixed date
public DateTime ExpiryDate { get; set; }
}
Record for identifying certificates by file paths.
var certId = new CertificateId(
CertPemFilePath: "/path/to/cert.pem",
KeyPemFilePath: "/path/to/key.pem",
Password: "optional-password"
);
Interface for retrieving X509 certificates based on certificate identifiers.
public class MyCertificateProvider : ICertificateProvider
{
public X509Certificate2 GetCertificate(CertificateId certificateId)
{
// Implementation to load certificate
}
}
This library targets both .NET 8.0 and .NET 9.0, with appropriate dependencies for each framework.
FAQs
A collection of utility classes featuring OData extensions, GeoJson converters for NetTopologySuite and Microsoft.Spatial, geographical property filters for OData, custom formatters (CSV, CBOR, YAML), and dependency injection for AuthSessionService.
We found that softalleys.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.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.