{"id":16874959,"url":"https://github.com/dlsniper/anyhash","last_synced_at":"2025-03-18T23:52:34.303Z","repository":{"id":57602097,"uuid":"60721372","full_name":"dlsniper/anyhash","owner":"dlsniper","description":"Hash anything in Go","archived":false,"fork":false,"pushed_at":"2016-06-08T20:02:24.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-25T00:49:46.426Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/dlsniper.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}},"created_at":"2016-06-08T18:38:21.000Z","updated_at":"2016-06-08T18:41:16.000Z","dependencies_parsed_at":"2022-09-26T20:00:51.816Z","dependency_job_id":null,"html_url":"https://github.com/dlsniper/anyhash","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlsniper%2Fanyhash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlsniper%2Fanyhash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlsniper%2Fanyhash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlsniper%2Fanyhash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dlsniper","download_url":"https://codeload.github.com/dlsniper/anyhash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244326209,"owners_count":20435122,"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":[],"created_at":"2024-10-13T15:34:45.412Z","updated_at":"2025-03-18T23:52:34.286Z","avatar_url":"https://github.com/dlsniper.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Anyhash\n\n[![GoDoc](https://godoc.org/github.com/dlsniper/anyhash?status.svg)](https://godoc.org/github.com/dlsniper/anyhash) [![Go Report Card](https://goreportcard.com/badge/github.com/dlsniper/anyhash)](https://goreportcard.com/report/github.com/dlsniper/anyhash) [![License](http://img.shields.io/:license-mit-blue.svg)](http://doge.mit-license.org)\n\nAnyhash is an attempt to hash anything you throw at it and get a slice of bytes.\n\nIt relies on the wonderful [xxHash](https://github.com/OneOfOne/xxhash) algorithm to do it fast.\n\nPlease read the whole readme before you proceed.\n\n## Usage\n\n```go\nfunc demo() {\n    hash := anyhash.Hash(\"my data goes here\")\n    // your code here\n}\n```\n\n## Benchmarks\n\nBecause that's what's important:\n\n- CPU\n```\nNative\n\nBenchmarkSimpleJSON-8            1000000              1371 ns/op\nBenchmarkSimpleDump-8            1000000              1846 ns/op\nBenchmarkFullJSON-8               200000              8032 ns/op\nBenchmarkFullDump-8               500000              3237 ns/op\nBenchmarkTagsJSON-8              2000000               780 ns/op\nBenchmarkTagsDump-8              1000000              1249 ns/op\n\n\ncgo\n\nBenchmarkSimpleJSON-8            1000000              1353 ns/op\nBenchmarkSimpleDump-8            1000000              2074 ns/op\nBenchmarkFullJSON-8               200000              8094 ns/op\nBenchmarkFullDump-8               500000              3429 ns/op\nBenchmarkTagsJSON-8              2000000               784 ns/op\nBenchmarkTagsDump-8              1000000              1626 ns/op\n```\n\n- Memory\n```\nNative\n\nBenchmarkSimpleJSON-8            1000000              1400 ns/op             328 B/op          3 allocs/op\nBenchmarkSimpleDump-8            1000000              2034 ns/op             576 B/op         16 allocs/op\nBenchmarkFullJSON-8               200000              9961 ns/op            2632 B/op         12 allocs/op\nBenchmarkFullDump-8               500000              4042 ns/op            1104 B/op         20 allocs/op\nBenchmarkTagsJSON-8              2000000               926 ns/op             184 B/op          2 allocs/op\nBenchmarkTagsDump-8              1000000              1550 ns/op             296 B/op         12 allocs/op\n\n\ncgo\n\nBenchmarkSimpleJSON-8            1000000              1360 ns/op             328 B/op          3 allocs/op\nBenchmarkSimpleDump-8            1000000              2165 ns/op             624 B/op         18 allocs/op\nBenchmarkFullJSON-8               200000              8398 ns/op            2632 B/op         12 allocs/op\nBenchmarkFullDump-8               500000              3432 ns/op            1152 B/op         22 allocs/op\nBenchmarkTagsJSON-8              2000000               760 ns/op             184 B/op          2 allocs/op\nBenchmarkTagsDump-8              1000000              1521 ns/op             344 B/op         14 allocs/op\n```\n\n## If you've made it this far...\n\nPlease don't use it as dependency, it's awful, just copy-paste the code if you must.\n\nI've done it in \u003c 5 minutes, so can you!\n\n### Production usage\n\nDon't do it, just don't.\n\n## Thanks\n\nThanks to the folks on slack for improving this, you know who you are.\n\n## Credits\n\nCredits go to [cnf](https://github.com/cnf) for the test data which happens to be compatible with [this package](https://github.com/cnf/structhash)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlsniper%2Fanyhash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdlsniper%2Fanyhash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlsniper%2Fanyhash/lists"}