{"id":18338987,"url":"https://github.com/xoofx/smash","last_synced_at":"2026-02-28T12:37:09.336Z","repository":{"id":71954802,"uuid":"108263683","full_name":"xoofx/smash","owner":"xoofx","description":"Smash provides a collection of non-cryptographic hashes for .NET","archived":false,"fork":false,"pushed_at":"2024-03-17T14:04:29.000Z","size":73,"stargazers_count":20,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-21T18:05:42.757Z","etag":null,"topics":["dotnet","hash","hash-checksum","hash-functions","xxhash"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xoofx.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","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},"funding":{"github":["xoofx"]}},"created_at":"2017-10-25T11:58:47.000Z","updated_at":"2025-02-19T02:32:15.000Z","dependencies_parsed_at":"2024-03-17T15:25:20.510Z","dependency_job_id":"c46a93b6-9b09-424e-ae0b-5675382cc40d","html_url":"https://github.com/xoofx/smash","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xoofx%2Fsmash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xoofx%2Fsmash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xoofx%2Fsmash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xoofx%2Fsmash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xoofx","download_url":"https://codeload.github.com/xoofx/smash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305904,"owners_count":20917201,"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":["dotnet","hash","hash-checksum","hash-functions","xxhash"],"created_at":"2024-11-05T20:16:07.949Z","updated_at":"2026-02-28T12:37:04.300Z","avatar_url":"https://github.com/xoofx.png","language":"C#","funding_links":["https://github.com/sponsors/xoofx"],"categories":[],"sub_categories":[],"readme":"# smash [![Build status](https://ci.appveyor.com/api/projects/status/1dr6gc2jigpgai0v?svg=true)](https://ci.appveyor.com/project/xoofx/smash)   [![NuGet](https://img.shields.io/nuget/v/Smash.svg)](https://www.nuget.org/packages/Smash/)\n\n\u003cimg align=\"right\" width=\"160px\" height=\"160px\" src=\"img/smash.png\"\u003e\n\nSmash is a fast and lightweight library that provides a collection of non-cryptographic hashes for .NET\n\n```C#\n// Computes the hash of the following int32\nvar hash = xxHash.Create64();\nhash.Write(1);\nhash.Write(2);\nhash.Write(3);\nhash.Write(4);\nvar value = hash.Compute();\n```\n\n## Features\n\n- Provides an implementation for the following hash methods:\n  - [X] [**`xxHash`**](https://github.com/Cyan4973/xxHash)\n  - TODO: If you are looking for another hash method, PR are welcome!\n- **Pure .NET implementation**\n- **32bits and 64bits hashes** whenever they are provided by the underlying method\n- Fast computation using **aggressive inlining**\n- **Zero allocation** library, using only structs, no managed objects.\n- Allow **progressive hash computation**, the hash state is updated on each `Write` but the hash is computed once `Compute` is called\n  - Allows incremental hashes, copy of hashes before appending new data...etc.\n- Allows to compute the **hash for structured data** (`Write(int32)`, `Write(short)`...etc.) and not only for a `byte[]`\n  - This is useful when computing the hash of some datas without having to serialize them to a `byte[]`\n- Provides a generic [`HashStream\u003cTHash\u003e`](src/Smash/HashStream.cs) to update a hash while reading/writing from another stream.\n\n## Note\n\nThe API is **write count and type dependent**, meaning that the following are not generating the same hash, despite their in-memory representation is the same.\n\n```C#\nvar hash1 = xxHash.Create64();\nhash1.Write((byte)0xFF);\nhash1.Write((byte)0xFF);\n\nvar hash2 = xxHash.Create64();\nhash2.Write((ushort)0xFFFF);\n\n// Note that hash1 != hash2 in this case\n```\n\nIf you want to be binary compatible for any writes, you will have to use just once the methods `Write(byte[], int, int)` or `Write(IntPtr, ulong)`, as you would do with regular hashes functions.\n\n## Binaries\n\nSmash is available as a NuGet package: [![NuGet](https://img.shields.io/nuget/v/Smash.svg)](https://www.nuget.org/packages/Smash/)\n\nCompatible with the following .NET framework profiles:\n\n- `.NET3.5`\n- `.NET4.0+`\n- `UAP10.0+`\n- `NetStandard1.1` running on `.NET4.5+` and `CoreCLR` runtimes\n\nAlso [Smash.Signed](https://www.nuget.org/packages/Smash.Signed/) NuGet package provides signed assemblies.\n\n## License\n\nThis software is released under the [BSD-Clause 2 license](http://opensource.org/licenses/BSD-2-Clause). \n\n## Credits\n\nSmash is just an implementation of existing hash methods. All the credits should go to the following libraries.\n\n* [**`xxHash`**](https://github.com/Cyan4973/xxHash)\n\n## Author\n\nAlexandre Mutel aka [xoofx](https://xoofx.github.io).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxoofx%2Fsmash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxoofx%2Fsmash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxoofx%2Fsmash/lists"}