{"id":19564909,"url":"https://github.com/levy-y/utils-lib","last_synced_at":"2025-02-26T09:23:01.302Z","repository":{"id":238336743,"uuid":"796346859","full_name":"Levy-Y/utils-lib","owner":"Levy-Y","description":"Some useful C# utility classes to use","archived":false,"fork":false,"pushed_at":"2024-05-05T20:06:06.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-08T23:59:31.596Z","etag":null,"topics":["csharp","utilities","utils-library"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Levy-Y.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-05T17:11:31.000Z","updated_at":"2024-10-18T18:59:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"ede43bad-b331-4622-8a02-5ddfd58a1642","html_url":"https://github.com/Levy-Y/utils-lib","commit_stats":null,"previous_names":["levy-y/utils-lib"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Levy-Y%2Futils-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Levy-Y%2Futils-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Levy-Y%2Futils-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Levy-Y%2Futils-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Levy-Y","download_url":"https://codeload.github.com/Levy-Y/utils-lib/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240823744,"owners_count":19863501,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","utilities","utils-library"],"created_at":"2024-11-11T05:24:18.529Z","updated_at":"2025-02-26T09:23:01.182Z","avatar_url":"https://github.com/Levy-Y.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Utils Library\n\n![Utils Library](https://img.shields.io/badge/language-C%23-blue) ![version](https://img.shields.io/badge/version-1.0-blue)\n\n## Introduction\n\nThe Utils Library is a collection of utility methods written in C# that i commonly use, to perform common tasks such as mathematical calculations, string formatting, array manipulation, HTTP requests, and more. This library aims to provide convenient and efficient solutions for developers across various C# projects.\n\n## Features\n\n- **Sum**: Calculate the sum of all numbers in an array of integers.\n- **Average**: Calculate the average value of numbers in an array.\n- **Absolute Value**: Calculate the absolute value of a given float number.\n- **Average Absolute Difference**: Calculate the average absolute difference between each number in an array and the average of all numbers.\n- **Format Phone Number**: Format a phone number string by removing spaces, dashes, and parentheses, and inserting dashes at specific positions.\n- **Find Maximum Element**: Find the maximum element in an array.\n- **Reverse Array**: Reverse the order of elements in an array.\n- **Factorial**: Calculate the factorial of a non-negative integer.\n- **Safe Divide**: Safely divide one double number by another, avoiding division by zero.\n- **Make Request**: Make an HTTP request to the specified URL using the specified HTTP method, with optional authentication token inclusion.\n\n## Installation\n\nYou can download the latest release of the Utils Library from the [GitHub Releases](https://github.com/Levy-Y/utils-lib/releases) page. Choose the appropriate release package for your project and include the library assembly in your project references.\n\n## Usage\n\n### Example Usage:\n\n```csharp\nusing utils_lib;\n\nclass Program\n{\n    static void Main(string[] args)\n    {\n        int[] numbers = { 1, 2, 3, 4, 5 };\n        float[] floatNumbers = { 1.5f, 2.5f, 3.5f, 4.5f, 5.5f };\n        string phoneNumber = \"(123) 456-7890\";\n        string url = \"https://api.example.com/data\";\n        string token = \"your_auth_token\";\n\n        // Calculate sum\n        float sum = Utils.Sum(numbers);\n        Console.WriteLine(\"Sum: \" + sum);\n\n        // Calculate average\n        float avg = Utils.Avg(floatNumbers);\n        Console.WriteLine(\"Average: \" + avg);\n\n        // Format phone number\n        string formattedPhoneNumber = Utils.FormatPhoneNumber(phoneNumber);\n        Console.WriteLine(\"Formatted Phone Number: \" + formattedPhoneNumber);\n\n        // Make HTTP request\n        string response = await Utils.MakeRequest(url, HttpMethod.Get, token);\n        Console.WriteLine(\"Response: \" + response);\n    }\n}\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nContributions are welcome! Feel free to submit pull requests, report bugs, or suggest improvements.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevy-y%2Futils-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flevy-y%2Futils-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevy-y%2Futils-lib/lists"}