{"id":13694270,"url":"https://github.com/dchest/siphash","last_synced_at":"2025-05-15T12:04:08.216Z","repository":{"id":3662288,"uuid":"4730892","full_name":"dchest/siphash","owner":"dchest","description":"Go implementation of SipHash-2-4, a fast short-input PRF created by Jean-Philippe Aumasson and Daniel J. Bernstein.","archived":false,"fork":false,"pushed_at":"2022-04-27T20:39:36.000Z","size":59,"stargazers_count":282,"open_issues_count":0,"forks_count":42,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-14T19:59:35.008Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dchest.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":"2012-06-20T20:12:17.000Z","updated_at":"2025-02-18T01:58:50.000Z","dependencies_parsed_at":"2022-09-17T04:52:07.176Z","dependency_job_id":null,"html_url":"https://github.com/dchest/siphash","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dchest%2Fsiphash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dchest%2Fsiphash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dchest%2Fsiphash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dchest%2Fsiphash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dchest","download_url":"https://codeload.github.com/dchest/siphash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254337612,"owners_count":22054253,"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-08-02T17:01:28.291Z","updated_at":"2025-05-15T12:04:03.188Z","avatar_url":"https://github.com/dchest.png","language":"Go","funding_links":[],"categories":["开源类库","Open source library"],"sub_categories":["数据结构","Data Structure"],"readme":"SipHash (Go)\n============\n\nGo implementation of SipHash-2-4, a fast short-input PRF created by\nJean-Philippe Aumasson and Daniel J. Bernstein (http://131002.net/siphash/).\n\n\n## Installation\n\n    $ go get github.com/dchest/siphash\n\n## Usage\n\n    import \"github.com/dchest/siphash\"\n\nThere are two ways to use this package.\nThe slower one is to use the standard hash.Hash64 interface:\n\n    h := siphash.New(key)\n    h.Write([]byte(\"Hello\"))\n    sum := h.Sum(nil) // returns 8-byte []byte\n\nor\n\n    sum64 := h.Sum64() // returns uint64\n\nThe faster one is to use Hash() function, which takes two uint64 parts of\n16-byte key and a byte slice, and returns uint64 hash:\n\n    sum64 := siphash.Hash(key0, key1, []byte(\"Hello\"))\n\nThe keys and output are little-endian.\n\n\n## Functions\n\n### func Hash(k0, k1 uint64, p []byte) uint64\n\nHash returns the 64-bit SipHash-2-4 of the given byte slice with two\n64-bit parts of 128-bit key: k0 and k1.\n\n### func Hash128(k0, k1 uint64, p []byte) (uint64, uint64)\n\nHash128 returns the 128-bit SipHash-2-4 of the given byte slice with two\n64-bit parts of 128-bit key: k0 and k1.\n\nNote that 128-bit SipHash is considered experimental by SipHash authors at this time.\n\n### func New(key []byte) hash.Hash64\n\nNew returns a new hash.Hash64 computing SipHash-2-4 with 16-byte key.\n\n### func New128(key []byte) hash.Hash\n\nNew128 returns a new hash.Hash computing SipHash-2-4 with 16-byte key and 16-byte output.\n\nNote that 16-byte output is considered experimental by SipHash authors at this time.\n\n\n## Public domain dedication\n\nWritten by Dmitry Chestnykh and Damian Gryski.\n\nTo the extent possible under law, the authors have dedicated all copyright\nand related and neighboring rights to this software to the public domain\nworldwide. This software is distributed without any warranty.\nhttp://creativecommons.org/publicdomain/zero/1.0/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdchest%2Fsiphash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdchest%2Fsiphash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdchest%2Fsiphash/lists"}