Mythosia 1.1.5
See the version list below for details.
dotnet add package Mythosia --version 1.1.5
NuGet\Install-Package Mythosia -Version 1.1.5
<PackageReference Include="Mythosia" Version="1.1.5" />
<PackageVersion Include="Mythosia" Version="1.1.5" />
<PackageReference Include="Mythosia" />
paket add Mythosia --version 1.1.5
#r "nuget: Mythosia, 1.1.5"
#:package Mythosia@1.1.5
#addin nuget:?package=Mythosia&version=1.1.5
#tool nuget:?package=Mythosia&version=1.1.5
Mythosia
This project supports custom functions that are not directly provided by .NET as extension methods so that they can be conveniently used within the project. <br/> The extensions supported by this project include the following. <br/>
String
using Mythosia;
var data = "12345".ToDefaultArray(); // Equal with Encoding.Default.GetBytes("12345");
var data = "12345".ToASCIIArray(); // Equal with Encoding.ASCII.GetBytes("12345");
var data = "12345".ToUTF8Array(); // Equal with Encoding.UTF8.GetBytes("12345");
var data = "12345".ToUTF32Array(); // Equal with Encoding.UTF32.GetBytes("12345");
var data = "=".Repeat(10); // data is "=========="
Numeric (sbyte, byte, short, ushort, int, uint, float, double)
using Mythosia;
var result = 56.IsInRange(0, 100); // result is true
var result = 56.IsInRange(0, 30); // result is false
// see https://m.blog.naver.com/alluck/220931066035
var data = 56000000.ToSIPrefix(); // data is "56 M" (find the unit that can present the best simple)
var data = 56000000.ToSIPrefix(SIPrefixUnit.Kilo); // data is "56000 k"
var data = 56000000.ToSIPrefix(SIPrefixUnit.Giga, 5); // data is "0.056 G" (the second param means the maximum number of digits after decimal point)
var data = 1.4235123.ToSIPrefix(); // data is "1.42" (find the unit that can present the best simple)
var data = 1.4235123.ToSIPrefix(SIPrefixUnit.Mili); // data is "1423.51 m"
var data = 1.4235123.ToSIPrefix(SIPrefixUnit.Mili, 5); // data is "1423.5123 m"
var data = 1.4235123.ToSIPrefix(SIPrefixUnit.Micro); // data is "1423512.3 u"
var data = 423.42031.HostToNetworkEndian(); // change endian (host to big)
var data = 234.52.ToByteArray(); // Equal with BitConverter.GetBytes(234.52);
Enumerable (included ConcurrentBag)
using Mythosia;
new List<byte> test = new List<byte>(){0xff, 0xab, 0x01, 0x00, 0xee};
var result = test.ToUnPrefixedHexString(); // result is "ff ab 01 00 ee"
var result = test.ToPrefixedHexString(); // result is "0xffab0100ee"
var result = test.ToEncodedString(Encoding.GetEncoding("ISO-8859-1")); // convert string as "ISO-8859-1" format
var result = test.ToASCIIString(); // equal with Encoding.ASCII.GetString(test.ToArray(), 0, test.Count());
var result = test.IndexOf(new List(){ 0xab, 0x01 }); // return the index that subsequence is finded.
test.AddExceptNull(item); // add item if item is not null
new List<byte> newItems = new List<bye>(){ 0x01, 0x02 };
test.AddRangeParallel(newItems); // add items as parallel
Delegate
using Mythosia;
// If you have a function that success or fails according to condition as below.
bool WireConnect()
{
// Check whether the wire is connected
// If connected to wire return true else false.
}
// Here you may want to call the function to repeat to specified timeout.
// Then you can solute just by calling the function "Retry" as below.
void Test()
{
var func = WireConnect; // you need c# 10.0
bool result = func.Retry(30000); // Call WireConnect function to repeat while a maximum of 30,000 ms (the 30s) or until success
if(result) Console.WriteLine("Success");
else Console.WriteLine("Failed");
}
Stream
using Mythosia;
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public class TestMarshalClass
{
public int a;
public int b;
}
TestMarshalClass test = new();
var serializeData = test.SerializeUsingMarshal(); // Serialize
test.DeSerializeUsingMarshal(serializeData); // Deserialize to test
Enum
using Mythosia;
public enum CarBrand
{
[Description("Mercedes")] Benz = 0,
[Description("Bayerische Motoren Werke AG")] BMW,
}
CarBrand test = CarBrand.Benz;
var value = test.ToDescription(); // value is "Mercedes"
var enum = value.GetEnumFromDescription<CarBrand>(); // enum is CarBrand.Benz
int carBrand = 1;
var enum = carBrand.ToEnum<CarBrand>(); // enum is CarBrand.BMW
DataStruct
using Mythosia;
using Mythosia.Collections;
CircularQueue<byte> testQ = new (3); // create circular queue with max size is 3
testQ.Enqueue(10); // 10
testQ.Enqueue(5); // 10 5
testQ.Enqueue(26); // 10 5 26
testQ.Enqueue(16); // 16 5 26
// if you want to use a thread-safe circular queue,
// all you have to do is create a circular queue with the true parameter as below.
CircularQueue<byte> testQ = new (3, true); // create thread-safe circular queue
Product | Versions 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 | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- No dependencies.
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Mythosia:
Package | Downloads |
---|---|
Mythosia.Integrity
From this version, you can use the polymorphism. Please see the GitHub readme file. support checksum8: 1. xor (using in NMEA format) 2. modulo-256 3. 2's complement support CRC8: 1. CRC8 2. CRC8 Maxim support CRC16: 1. CRC16 2. CRC16 (modbus) 3. CRC16 CCITT (xModem) 4. CRC16 DNP support CRC32 1. CRC32 |
|
Mythosia.AI
The `Mythosia.AI` library provides a unified interface for various AI models with **multimodal support**, including **OpenAI GPT-4o**, **Anthropic Claude 3**, **Google Gemini**, **DeepSeek**, and **Perplexity Sonar**. ## 🚀 What's New in v2.0 - **Multimodal Support**: Send images along with text to compatible AI models - **Stateless Mode**: Process requests independently without maintaining conversation history - **Fluent Message Builder**: Easily construct complex multimodal messages - **Enhanced Extensions**: Convenient helper methods for common scenarios - **Web Search Integration**: Real-time web search with citations (Perplexity Sonar) - **Audio Support**: Text-to-Speech and Speech-to-Text (OpenAI) ## Supported Models - **OpenAI**: GPT-4o (latest, 2024-08-06), GPT-4o-mini, GPT-3.5 Turbo - **Anthropic**: Claude 3.5 Sonnet, Claude 3.5 Haiku, Claude 3 Opus - **Google**: Gemini 1.5 Flash, Gemini 1.5 Pro, Gemini Pro Vision - **DeepSeek**: DeepSeek Chat, DeepSeek Reasoner - **Perplexity**: Sonar, Sonar Pro, Sonar Reasoning ## Key Features - ✅ Synchronous and streaming completions - ✅ Image analysis (OpenAI GPT-4o, Claude 3, Gemini) - ✅ Image generation (OpenAI DALL-E) - ✅ Audio transcription and generation (OpenAI) - ✅ Web search with citations (Perplexity) - ✅ Token counting and management - ✅ Conversation history management - ✅ Model switching on the fly - ✅ Comprehensive error handling ## Quick Examples ```csharp // Basic setup (don't forget the using statements!) using Mythosia.AI; using Mythosia.AI.Extensions; // Required for BeginMessage() and other extensions var service = new ChatGptService(apiKey, httpClient); // Text completion var response = await service.GetCompletionAsync("What is AI?"); // Image analysis (with GPT-4o) service.ActivateChat.ChangeModel(AIModel.Gpt4oLatest); var analysis = await service.GetCompletionWithImageAsync( "Describe this image", "photo.jpg"); // Fluent API for complex messages await service.BeginMessage() .AddText("Compare these images") .AddImage("before.jpg") .AddImage("after.jpg") .SendAsync(); // Stateless mode for independent requests service.StatelessMode = true; await service.GetCompletionAsync("Translate: Hello"); // No history // One-off queries without affecting conversation var quickAnswer = await service.AskOnceAsync("What time is it?"); ``` Full documentation and examples: https://github.com/AJ-comp/Mythosia/tree/master/Mythosia.AI |
|
Mythosia.Azure.Storage.Blobs
**New Features**: This update introduces an extension method to automatically convert strings into valid Azure Blob Storage container names. Azure Blob Storage imposes strict naming rules requiring lowercase letters, numbers, and hyphens, with specific constraints on hyphen placement and name length. This new feature ensures that container names comply with these rules by transforming arbitrary input strings into valid container names seamlessly. **Key Benefits**: - Converts camelCase or PascalCase strings to lowercase with hyphens automatically. - Replaces disallowed characters with hyphens, ensuring valid naming conventions. - Handles name length constraints (minimum 3 characters, maximum 63 characters). - Simplifies compliance with Azure Blob Storage naming standards, reducing errors and improving consistency. **Usage Example**: ```csharp using Mythosia.Azure.Storage.Blobs; // Convert a string to a valid container name string validName = "PhonoMaster@123".ToBlobContainerName(); // Output: "phono-master-123" ``` |
|
Mythosia.Security.Cryptography
support symmetric algorithm 1. AES128 2. AES192 3. AES256 4. 3DES 5. DES 6. SEED support HashCode for IV (Integrity Verification) 1. SHA1 2. SHA256 3. SHA384 4. SHA512 5. MD2 6. MD4 7. MD5 refer to https://github.com/AJ-comp/Mythosia/tree/master/Mythosia.Security.Cryptography for detail. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.4.0 | 341 | 11/9/2024 |
1.3.0 | 116 | 10/25/2024 |
1.2.4 | 123 | 10/23/2024 |
1.2.3 | 339 | 6/17/2024 |
1.2.2 | 1,108 | 10/16/2023 |
1.2.1 | 1,134 | 8/20/2023 |
1.2.0 | 2,255 | 8/9/2023 |
1.1.5 | 1,195 | 7/17/2023 |
1.1.4 | 1,196 | 7/3/2023 |
1.1.3 | 1,226 | 7/3/2023 |
1.1.2 | 1,088 | 6/28/2023 |
1.1.1 | 1,346 | 6/25/2023 |
1.1.0 | 1,156 | 6/23/2023 |
1.0.3 | 1,161 | 6/23/2023 |
1.0.2 | 1,131 | 6/21/2023 |
1.0.1 | 1,355 | 6/19/2023 |
1.0.0 | 1,244 | 6/18/2023 |