MHBasicMethods 1.1.0

dotnet add package MHBasicMethods --version 1.1.0
                    
NuGet\Install-Package MHBasicMethods -Version 1.1.0
                    
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="MHBasicMethods" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MHBasicMethods" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="MHBasicMethods" />
                    
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 MHBasicMethods --version 1.1.0
                    
#r "nuget: MHBasicMethods, 1.1.0"
                    
#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 MHBasicMethods@1.1.0
                    
#: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=MHBasicMethods&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=MHBasicMethods&version=1.1.0
                    
Install as a Cake Tool

Basic C# Methods (V 1.1.0)

MHConvert (to use this initialize MHConvert)

MHConvert mhConvert = new MHConvert()
01. double FahrenheitToCelsius(double fahrenheit)
02. double CelsiusToFahrenheit(double celsius)
03. double CentimetersToInches(double centimeters)
04. double InchesToCentimeters(double inches)
05. double FeetToMeters(double feet)
06. double MetersToFeet(double meters)
07. double PoundsToKilograms(double pounds)
08. double KilogramsToPounds(double kilograms)
09. double MilesToKilometers(double miles)
10. double KilometersToMiles(double kilometers)
11. double GallonsToLiters(double gallons)
12. double LitersToGallons(double liters)
18. double HoursToMinutes(double hours)
19. double MinutesToHours(double minutes)
20. double HoursToSeconds(double hours)
21. int BinaryToDecimal(string binary)
22. string DecimalToBinary(int decimalValue)
23. byte[] StringToByteArray(string input)
24. string ByteArrayToString(byte[] bytes)

MHDate (to use this initialize MHDate)

MHDate mhDate = new MHDate()
01. int CalculateAge(DateTime birthdate)
02. List<DateTime> GetFirstAndLastDayOfMonth(DateTime date)
03. bool IsLeapYear(int year)
04. string FormatElapsedTime(DateTime startDate)
05. DateTime FindNextWeekday(DateTime startDate, DayOfWeek weekday)
06. int CalculateDaysBetweenDates(DateTime startDate, DateTime endDate)
07. void CalculateAgeDetailed(DateTime birthDate, DateTime currentDate, out int days, out int hours, out int minutes, out int seconds)

MHNumbers (to use this initialize MHNumbers)

MHNumbers mhNumbers = new MHNumbers
01. string ConvertNumberToWords(int number)
02. List<int> FindPrimeNumbers(int n)
03. int CalculateFactorial(int n)
04. List<int> GenerateFibonacciSeries(int n)
05. int FindGCD(int a, int b)
06. double CalculatePower(double baseNumber, int exponent)
07. bool IsArmstrongNumber(int number)
08. int FindLCM(int a, int b)
09. bool IsPalindrome(int number)
10. bool IsPerfectNumber(int number)
11. double CalculateSquareRoot(double number)
12. string DecimalToBinary(int decimalNumber)
13. int BinaryToDecimal(string binaryNumber)
14. bool IsPowerOfTwo(int number)
15. int CountDigits(int number)
16. double CalculateExponentiation(double baseNumber, int exponent)
17. bool IsHappyNumber(int number)
18. bool IsHarshadNumber(int number)
19. List<int> GeneratePrimesInRange(int start, int end)

MHRandom (to use this initialize MHRandom)

MHRandom mhRandom = new MHRandom
01. string GenerateRandomAlphanumeric(int length)
02. string GenerateRandomGuid()
03. string GenerateRandomUniqueCodeWithPrefix(string prefix, int length)
04. string GenerateRandomHexadecimal(int length)
05. string GenerateRandomPronounceablePassword(int length)
06. string GenerateRandomBase64String(int length)
07. string GenerateRandomString(int length, string customCharacterSet)
08. string GenerateRandomEmailAddress()
09. string GenerateRandomPhoneNumber()
10. DateTime GenerateRandomDate(DateTime startDate, DateTime endDate)
11. string GenerateRandomIPv4Address()
12. string GenerateRandomStringWithPrefixAndSuffix(string prefix, string suffix, int length)
13. string GenerateRandomNumber(int length)
14. string GenerateRandomKey(int length, bool includeNumbers, bool includeLowercase, bool includeUppercase, bool includeSpecialCharacters)

MHEncryption (to use this initialize MHEncrypt)

MHEncryption mhEncryption = new MHEncryption
01. string Encrypt(string plainText, string secretKey)
02. string Decrypt(string cipherText, string secretKey)
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

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.1.0 361 11/4/2023
1.0.7 225 11/3/2023
1.0.6 188 11/3/2023
1.0.5 190 11/3/2023
1.0.4 210 11/3/2023
1.0.3 199 11/2/2023
1.0.1 209 11/2/2023
1.0.0 192 11/2/2023