{"id":20850585,"url":"https://github.com/multiformats/go-multicodec","last_synced_at":"2025-05-16T07:06:28.340Z","repository":{"id":36753014,"uuid":"41059668","full_name":"multiformats/go-multicodec","owner":"multiformats","description":"Go constants for the multicodec table","archived":false,"fork":false,"pushed_at":"2025-03-28T13:06:30.000Z","size":262,"stargazers_count":36,"open_issues_count":0,"forks_count":12,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-08T17:17:03.319Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/multiformats.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":"2015-08-19T21:02:29.000Z","updated_at":"2025-03-28T13:06:33.000Z","dependencies_parsed_at":"2024-06-18T14:02:11.663Z","dependency_job_id":"657a4fb7-8a24-4167-b545-1d6cc0b50b14","html_url":"https://github.com/multiformats/go-multicodec","commit_stats":null,"previous_names":["jbenet/go-multicodec"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Fgo-multicodec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Fgo-multicodec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Fgo-multicodec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Fgo-multicodec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/multiformats","download_url":"https://codeload.github.com/multiformats/go-multicodec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254485063,"owners_count":22078767,"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-11-18T03:10:23.503Z","updated_at":"2025-05-16T07:06:28.293Z","avatar_url":"https://github.com/multiformats.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-multicodec\n\n[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg)](https://github.com/RichardLitt/standard-readme)\n\n\u003e Generated Go constants for the [multicodec table](https://github.com/multiformats/multicodec) used by the [multiformats](https://github.com/multiformats/multiformats) projects.\n\n## Table of Contents\n\n- [Install](#install)\n- [Type](#type)\n- [Usage](#usage)\n  - [Importing Code constant](#importing-code-constant)\n  - [Code from string](#code-from-string)\n  - [Code from uint64](#code-from-uint64)\n- [Generator](#generator)\n  - [With old table.csv](#with-old-tablecsv)\n  - [With updated table.csv](#with-updated-tablecsv)\n- [Maintainers](#maintainers)\n- [Contribute](#contribute)\n- [License](#license)\n\n## Install\n\n`go-multicodec` is a standard Go module:\n\n\tgo get github.com/multiformats/go-multicodec\n\n\n## Type\n\n`Code` describes an integer reserved in the multicodec table, defined at [multiformats/multicodec/table.csv](https://github.com/multiformats/multicodec/blob/master/table.csv).\n\n```go\ntype Code uint64\n```\n\n## Usage\n\n### Importing Code constant\n\n```go\npackage main\n\nimport \"github.com/multiformats/go-multicodec\"\n\nfunc main() {\n\tcode := multicodec.Sha2_256 // Code\n\tname := multicodec.Sha2_256.String()\n}\n```\n\nThe corresponding `name` value for each codec from the [multicodecs table](https://raw.githubusercontent.com/multiformats/multicodec/master/table.csv) can be accessed via its `String` method. For example, `multicodec.Sha2_256.String()` will return `sha2-256`.\n\n### Code from string\n\n```go\nvar multicodec.Code code \nerr := code.Set(\"libp2p-key\")\n```\n\n\n### Code from uint64\n\n```go\nrawCode := multicodec.Code(0x55)\n```\n\n## Generator\n\n### With old table.csv\n\nTo generate the constants yourself:\n\n```console\n$ git clone https://github.com/multiformats/go-multicodec\n$ cd go-multicodec\n$ git submodule init \u0026\u0026 git submodule update\n$ go generate\n```\n\nNote: You may need to install `stringer` via `go install golang.org/x/tools/cmd/stringer`.\n\n### With updated table.csv\n\nTo generate the constants for the latest [table.csv](https://github.com/multiformats/multicodec/blob/master/table.csv):\n\n```console\n$ git clone https://github.com/multiformats/go-multicodec\n$ cd go-multicodec\n$ git submodule init\n$ git submodule update --remote # updates ./multicodec/table.csv to upstream version\n$ go generate\n```\n\n## Maintainers\n\n[@mvdan](https://github.com/mvdan).\n\n## Contribute\n\nContributions welcome. Please check out [the issues](https://github.com/multiformats/go-multicodec/issues).\n\nCheck out our [contributing document](https://github.com/multiformats/multiformats/blob/master/contributing.md) for more information on how we work, and about contributing in general. Please be aware that all interactions related to multiformats are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).\n\nSmall note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.\n\n## License\n\nSPDX-License-Identifier: Apache-2.0 OR MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiformats%2Fgo-multicodec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmultiformats%2Fgo-multicodec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiformats%2Fgo-multicodec/lists"}