{"id":19244340,"url":"https://github.com/nanoframework/system.io.hashing","last_synced_at":"2025-04-21T09:33:37.385Z","repository":{"id":204028820,"uuid":"710907726","full_name":"nanoframework/System.IO.Hashing","owner":"nanoframework","description":"📦 .NET nanoFramework System.IO.Hashing","archived":false,"fork":false,"pushed_at":"2025-04-17T15:25:04.000Z","size":87,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-19T16:39:23.196Z","etag":null,"topics":["csharp","dotnet","esp32","hacktoberfest","iot","nanoframework","smt32"],"latest_commit_sha":null,"homepage":"https://www.nanoframework.net","language":"C#","has_issues":false,"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/nanoframework.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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},"funding":{"open_collective":"nanoframework","github":"nanoframework"}},"created_at":"2023-10-27T17:43:09.000Z","updated_at":"2025-04-17T15:25:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"20ecef58-cf99-4691-8dbf-af00d93025c3","html_url":"https://github.com/nanoframework/System.IO.Hashing","commit_stats":{"total_commits":20,"total_committers":3,"mean_commits":6.666666666666667,"dds":"0.19999999999999996","last_synced_commit":"a6ff014d46e237a520862fb44f1b7885c4c66c35"},"previous_names":["nanoframework/system.io.hashing"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanoframework%2FSystem.IO.Hashing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanoframework%2FSystem.IO.Hashing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanoframework%2FSystem.IO.Hashing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanoframework%2FSystem.IO.Hashing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nanoframework","download_url":"https://codeload.github.com/nanoframework/System.IO.Hashing/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250032470,"owners_count":21363841,"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","dotnet","esp32","hacktoberfest","iot","nanoframework","smt32"],"created_at":"2024-11-09T17:23:01.827Z","updated_at":"2025-04-21T09:33:32.365Z","avatar_url":"https://github.com/nanoframework.png","language":"C#","funding_links":["https://opencollective.com/nanoframework","https://github.com/sponsors/nanoframework"],"categories":[],"sub_categories":[],"readme":"[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=nanoframework_System.IO.Hashing\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=nanoframework_System.IO.Hashing) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=nanoframework_System.IO.Hashing\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=nanoframework_System.IO.Hashing) [![NuGet](https://img.shields.io/nuget/dt/nanoFramework.System.IO.Hashing.svg?label=NuGet\u0026style=flat\u0026logo=nuget)](https://www.nuget.org/packages/nanoFramework.System.IO.Hashing/) [![#yourfirstpr](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](https://github.com/nanoframework/Home/blob/main/CONTRIBUTING.md) [![Discord](https://img.shields.io/discord/478725473862549535.svg?logo=discord\u0026logoColor=white\u0026label=Discord\u0026color=7289DA)](https://discord.gg/gCyBu8T)\n\n![nanoFramework logo](https://raw.githubusercontent.com/nanoframework/Home/main/resources/logo/nanoFramework-repo-logo.png)\n\n-----\n\n# Welcome to the .NET **nanoFramework** System.IO.Hashing Library repository\n\nThis repository contains the nanoFramework System.IO.Hashing class library.\n\n## Build status\n\n| Component | Build Status | NuGet Package |\n|:-|---|---|\n| System.IO.Hashing | [![Build Status](https://dev.azure.com/nanoframework/System.IO.Hashing/_apis/build/status%2Fnanoframework.System.IO.Hashing?branchName=main)](https://dev.azure.com/nanoframework/System.IO.Hashing/_build/latest?definitionId=102\u0026branchName=main) | [![NuGet](https://img.shields.io/nuget/v/nanoFramework.System.IO.Hashing.svg?label=NuGet\u0026style=flat\u0026logo=nuget)](https://www.nuget.org/packages/nanoFramework.System.IO.Hashing/) |\n\n## System.IO.Hashing usage\n\n### CRC32 example\n\nThis implementation emits the answer in the Little Endian byte order so that the CRC residue relationship (CRC(message concat CRC(message)) is a fixed value). For CRC-32, this stable output is the byte sequence { 0x1C, 0xDF, 0x44, 0x21 }, the Little Endian representation of 0x2144DF1C.\n\n\u003e [!WARNING] There are multiple, incompatible, definitions of a 32-bit cyclic redundancy check (CRC) algorithm. When interoperating with another system, ensure that you are using the same definition. The definition used by this implementation is not compatible with the cyclic redundancy check described in ITU-T I.363.5.\n\n#### Computing a CRC32 for a byte array\n\n```csharp\n\nvar testData = new byte[] { 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x26, 0x39, 0xF4, 0xCB };\n\nCrc32 crc32 = new Crc32();\ncrc32.Append(testData);\n\nConsoleWriteline($\"CRC32 for test data is: {crc32.GetCurrentHashAsUInt32()}\");\n```\n\nAn alternative (static) API could be used instead.\n\n```csharp\n\nvar testData = new byte[] { 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x26, 0x39, 0xF4, 0xCB };\n\nvar computedHash = Crc32.HashToUInt32(testData)\n\nConsoleWriteline($\"CRC32 for test data is: {computedHash}\");\n```\n\n#### Computing a CRC32 for several data chunks\n\n```csharp\n\nvar testData1 = new byte[] { 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x26, 0x39, 0xF4, 0xCB };\nvar testData2 = new byte[] { 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0xD9, 0xC6, 0x0B, 0x34 },\n\nCrc32 crc32 = new Crc32();\ncrc32.Append(testData1);\ncrc32.Append(testData2);\n\nConsoleWriteline($\"CRC32 for test data is: {crc32.GetCurrentHashAsUInt32()}\");\n```\n\nIn case the `Crc32` object needs to be reused, it's a matter of resetting the hash calculator with a call to `Reset()`.\n\n#### Computing a CRC32 for strings\n\nThis can easily be accomplished by extrating the byte representation of a string. Note that this requires adding a reference to `nanoFramework.System.Text`.\n\n```csharp\nvar computedHash = Crc32.HashToUInt32(Encoding.UTF8.GetBytes(\"The quick brown fox jumps over the lazy dog\"))\n\nConsoleWriteline($\"CRC32 for the string is: {computedHash}\");\n```\n\n## Feedback and documentation\n\nFor documentation, providing feedback, issues and finding out how to contribute please refer to the [Home repo](https://github.com/nanoframework/Home).\n\nJoin our Discord community [here](https://discord.gg/gCyBu8T).\n\n## Credits\n\nThe list of contributors to this project can be found at [CONTRIBUTORS](https://github.com/nanoframework/Home/blob/main/CONTRIBUTORS.md).\n\n## License\n\nThe **nanoFramework** Class Libraries are licensed under the [MIT license](LICENSE.md).\n\n## Code of Conduct\n\nThis project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behaviour in our community.\nFor more information see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).\n\n### .NET Foundation\n\nThis project is supported by the [.NET Foundation](https://dotnetfoundation.org).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanoframework%2Fsystem.io.hashing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnanoframework%2Fsystem.io.hashing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanoframework%2Fsystem.io.hashing/lists"}