Compare commits

...

48 Commits

Author SHA1 Message Date
cf0ccd2f6e refactor(benchmark_test): migrate from github.com/ipfs/go-cid to code.sonr.org/go/cid
Some checks failed
Close Stale Issues / stale (push) Has been cancelled
Close Generated PRs / stale (push) Has been cancelled
Go Checks / go-check (push) Has been cancelled
Go Test / go-test (push) Has been cancelled
Releaser / releaser (push) Has been cancelled
Tag Push Checker / releaser (push) Has been cancelled
2026-01-08 15:46:16 -05:00
a7a1f319b3 docs(readme): update readme to reflect new package path 2026-01-08 15:46:14 -05:00
8c8b22eab1 docs(core): update deprecated comment with new pull request link 2026-01-08 15:46:13 -05:00
af732567fd chore(config): add Repo.toml and update go.mod for config changes 2026-01-08 15:46:12 -05:00
dependabot[bot]
1b3fc58457 chore(deps): bump golang.org/x/crypto from 0.35.0 to 0.45.0 (#179)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.35.0 to 0.45.0.
- [Commits](https://github.com/golang/crypto/compare/v0.35.0...v0.45.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.45.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-24 14:57:43 +13:00
Rod Vagg
594b41a340 v0.6.0 bump (#178) 2025-10-28 12:15:36 +11:00
dependabot[bot]
7942a87de8 chore(deps): bump github.com/multiformats/go-varint from 0.0.7 to 0.1.0 (#177)
Bumps [github.com/multiformats/go-varint](https://github.com/multiformats/go-varint) from 0.0.7 to 0.1.0.
- [Release notes](https://github.com/multiformats/go-varint/releases)
- [Commits](https://github.com/multiformats/go-varint/compare/v0.0.7...v0.1.0)

---
updated-dependencies:
- dependency-name: github.com/multiformats/go-varint
  dependency-version: 0.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-28 12:12:14 +11:00
Andrew Gillis
6365bffd65 Merge pull request #176 from ipfs/uci/update-go
ci: uci/update-go
2025-08-20 22:10:32 -07:00
web3-bot
1022508918 chore!: bump go.mod to Go 1.24 and run go fix
BREAKING CHANGE: Updating the Go version to 1.24
2025-08-20 16:22:55 +00:00
dependabot[bot]
1afa3fef92 chore(deps): bump golang.org/x/crypto from 0.31.0 to 0.35.0 (#175)
* chore(deps): bump golang.org/x/crypto from 0.31.0 to 0.35.0

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.31.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.31.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update go.mod

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rod Vagg <rod@vagg.org>
2025-04-15 10:32:11 +10:00
web3-bot
3b830eb57c ci: uci/copy-templates (#174)
* chore: add or force update .github/workflows/stale.yml

* chore: add or force update .github/workflows/generated-pr.yml
2025-03-28 19:15:37 +01:00
web3-bot
4d43496971 chore!: bump go.mod to Go 1.23 and run go fix (#173)
BREAKING CHANGE: Updating the Go version to 1.23
2025-02-16 22:33:16 +01:00
Rod Vagg
5cddba5d53 v0.5.0 bump (#172) 2025-01-22 13:02:05 +11:00
dependabot[bot]
c38d1ef3f4 chore(deps): bump golang.org/x/crypto from 0.17.0 to 0.31.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.17.0 to 0.31.0.
- [Commits](https://github.com/golang/crypto/compare/v0.17.0...v0.31.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-12 16:18:17 +11:00
Michael Muré
7f61b44eb9 move _rsrch/cidiface into an internal package
_rsrch/cidiface is an engineering experiment package to explore the right form for a CID. As such, it's not meant to be actually used, and could result in conflict if used.

To avoid accidentally importing it (or even getting suggestions to do so), this package is moved into an "internal" folder, hinting tooling that it's not meant for external consumption.
2024-09-27 09:13:31 +10:00
web3-bot
13ed68d2d7 chore!: bump go.mod to Go 1.22 and run go fix (#167) 2024-08-26 11:01:52 +10:00
web3-bot
b655a59a8a Merge pull request #166 from ipfs/uci/copy-templates
ci: uci/copy-templates
2024-03-22 12:54:37 +00:00
web3-bot
81bd42a55c chore: add or force update .github/workflows/tagpush.yml 2024-03-21 15:36:17 +00:00
web3-bot
23af06e490 chore: add or force update .github/workflows/release-check.yml 2024-03-21 15:36:17 +00:00
web3-bot
52653019a7 chore: add or force update .github/workflows/releaser.yml 2024-03-21 15:36:17 +00:00
web3-bot
11e146d86d chore: add or force update .github/workflows/go-check.yml 2024-03-21 15:36:17 +00:00
web3-bot
91f1b23adf chore: add or force update .github/workflows/go-test.yml 2024-03-21 15:36:17 +00:00
web3-bot
607591de0b chore: add or force update .github/workflows/tagpush.yml 2024-03-21 14:55:31 +00:00
web3-bot
93d2928381 chore: add or force update .github/workflows/release-check.yml 2024-03-21 14:55:31 +00:00
web3-bot
1f9bd88a8e chore: add or force update .github/workflows/releaser.yml 2024-03-21 14:55:31 +00:00
web3-bot
f6805b41a0 chore: add or force update .github/workflows/go-check.yml 2024-03-21 14:55:31 +00:00
web3-bot
01aca4cad3 chore: add or force update .github/workflows/go-test.yml 2024-03-21 14:55:31 +00:00
web3-bot
9b08623b01 chore: add or force update .github/workflows/tagpush.yml 2024-03-21 14:13:35 +00:00
web3-bot
1399b513f9 chore: add or force update .github/workflows/release-check.yml 2024-03-21 14:13:35 +00:00
web3-bot
00c494db15 chore: add or force update .github/workflows/releaser.yml 2024-03-21 14:13:35 +00:00
web3-bot
d1e16392a7 chore: add or force update .github/workflows/go-check.yml 2024-03-21 14:13:35 +00:00
web3-bot
af4cf3c53a chore: add or force update .github/workflows/go-test.yml 2024-03-21 14:13:35 +00:00
web3-bot
01fcc60a8c Merge pull request #165 from ipfs/uci/update-go
ci: uci/update-go
2024-03-14 11:40:58 +00:00
web3-bot
663c9b30cf chore: run go mod tidy 2024-03-13 14:58:09 +00:00
web3-bot
4a2ad46e4c chore: bump go.mod to Go 1.21 and run go fix 2024-03-13 14:58:09 +00:00
GitHub
a126b93d54 chore: Update .github/workflows/stale.yml [skip ci] 2024-01-31 17:37:03 +00:00
dependabot[bot]
7db2df1954 chore(deps): bump golang.org/x/crypto from 0.1.0 to 0.17.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.1.0 to 0.17.0.
- [Commits](https://github.com/golang/crypto/compare/v0.1.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-02 10:46:28 +11:00
web3-bot
d900d766af chore: bump go.mod to Go 1.20 and run go fix (#163) 2023-08-14 15:37:26 +02:00
web3-bot
aea9f4a20c chore: add or force update .github/workflows/tagpush.yml 2023-08-14 12:00:07 +10:00
web3-bot
6bf5ab9148 chore: add or force update .github/workflows/release-check.yml 2023-08-14 12:00:07 +10:00
web3-bot
ef021a6454 chore: add or force update .github/workflows/releaser.yml 2023-08-14 12:00:07 +10:00
web3-bot
13f45bfa17 chore: add or force update .github/workflows/go-check.yml 2023-08-14 12:00:07 +10:00
web3-bot
4828462368 chore: add or force update .github/workflows/go-test.yml 2023-08-14 12:00:07 +10:00
web3-bot
e12272217c chore: delete templates [skip ci] (#161) 2023-08-13 18:52:13 +02:00
GitHub
3863e676fd chore: Update .github/workflows/stale.yml [skip ci] 2023-06-28 08:49:10 +00:00
GitHub
9a3cbeb6a0 chore: Update .github/workflows/stale.yml [skip ci] 2023-06-14 11:15:02 +00:00
dependabot[bot]
f834302da4 chore(deps): bump github.com/multiformats/go-multihash
Bumps [github.com/multiformats/go-multihash](https://github.com/multiformats/go-multihash) from 0.2.2 to 0.2.3.
- [Release notes](https://github.com/multiformats/go-multihash/releases)
- [Commits](https://github.com/multiformats/go-multihash/compare/v0.2.2...v0.2.3)

---
updated-dependencies:
- dependency-name: github.com/multiformats/go-multihash
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-13 14:45:14 +10:00
dependabot[bot]
6b3d27fb29 chore(deps): bump github.com/multiformats/go-multihash
Bumps [github.com/multiformats/go-multihash](https://github.com/multiformats/go-multihash) from 0.2.1 to 0.2.2.
- [Release notes](https://github.com/multiformats/go-multihash/releases)
- [Commits](https://github.com/multiformats/go-multihash/compare/v0.2.1...v0.2.2)

---
updated-dependencies:
- dependency-name: github.com/multiformats/go-multihash
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-30 11:04:36 +10:00
24 changed files with 114 additions and 203 deletions

7
.github/Repo.toml vendored Normal file
View File

@@ -0,0 +1,7 @@
[scopes]
ci = [".github/workflows"]
config = [".github", "codecov.yml", "go.mod", "go.sum", "Makefile", "version.json"]
docs = ["README.md", "LICENSE"]
tests = ["*_test.go", "fuzz-data"]
research = ["_rsrch"]
core = ["cid.go", "builder.go", "set.go", "varint.go", "cid_fuzz.go", "deprecated.go"]

View File

@@ -1,11 +0,0 @@
# File managed by web3-bot. DO NOT EDIT.
# See https://github.com/protocol/.github/ for details.
name: Automerge
on: [ pull_request ]
jobs:
automerge:
uses: protocol/.github/.github/workflows/automerge.yml@master
with:
job: 'automerge'

14
.github/workflows/generated-pr.yml vendored Normal file
View File

@@ -0,0 +1,14 @@
name: Close Generated PRs
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
permissions:
issues: write
pull-requests: write
jobs:
stale:
uses: ipdxco/unified-github-workflows/.github/workflows/reusable-generated-pr.yml@v1

View File

@@ -1,67 +1,18 @@
# File managed by web3-bot. DO NOT EDIT.
# See https://github.com/protocol/.github/ for details.
on: [push, pull_request]
name: Go Checks name: Go Checks
on:
pull_request:
push:
branches: ["master"]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }}
cancel-in-progress: true
jobs: jobs:
unit: go-check:
runs-on: ubuntu-latest uses: ipdxco/unified-github-workflows/.github/workflows/go-check.yml@v1.0
name: All
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- id: config
uses: protocol/.github/.github/actions/read-config@master
- uses: actions/setup-go@v3
with:
go-version: 1.20.x
- name: Run repo-specific setup
uses: ./.github/actions/go-check-setup
if: hashFiles('./.github/actions/go-check-setup') != ''
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@4970552d932f48b71485287748246cf3237cebdf # 2023.1 (v0.4.0)
- name: Check that go.mod is tidy
uses: protocol/multiple-go-modules@v1.2
with:
run: |
go mod tidy
if [[ -n $(git ls-files --other --exclude-standard --directory -- go.sum) ]]; then
echo "go.sum was added by go mod tidy"
exit 1
fi
git diff --exit-code -- go.sum go.mod
- name: gofmt
if: success() || failure() # run this step even if the previous one failed
run: |
out=$(gofmt -s -l .)
if [[ -n "$out" ]]; then
echo $out | awk '{print "::error file=" $0 ",line=0,col=0::File is not gofmt-ed."}'
exit 1
fi
- name: go vet
if: success() || failure() # run this step even if the previous one failed
uses: protocol/multiple-go-modules@v1.2
with:
run: go vet ./...
- name: staticcheck
if: success() || failure() # run this step even if the previous one failed
uses: protocol/multiple-go-modules@v1.2
with:
run: |
set -o pipefail
staticcheck ./... | sed -e 's@\(.*\)\.go@./\1.go@g'
- name: go generate
uses: protocol/multiple-go-modules@v1.2
if: (success() || failure()) && fromJSON(steps.config.outputs.json).gogenerate == true
with:
run: |
git clean -fd # make sure there aren't untracked files / directories
go generate -x ./...
# check if go generate modified or added any files
if ! $(git add . && git diff-index HEAD --exit-code --quiet); then
echo "go generated caused changes to the repository:"
git status --short
exit 1
fi

View File

@@ -1,76 +1,20 @@
# File managed by web3-bot. DO NOT EDIT.
# See https://github.com/protocol/.github/ for details.
on: [push, pull_request]
name: Go Test name: Go Test
on:
pull_request:
push:
branches: ["master"]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }}
cancel-in-progress: true
jobs: jobs:
unit: go-test:
strategy: uses: ipdxco/unified-github-workflows/.github/workflows/go-test.yml@v1.0
fail-fast: false secrets:
matrix: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
os: [ "ubuntu", "windows", "macos" ]
go: ["1.19.x","1.20.x"]
env:
COVERAGES: ""
runs-on: ${{ fromJSON(vars[format('UCI_GO_TEST_RUNNER_{0}', matrix.os)] || format('"{0}-latest"', matrix.os)) }}
name: ${{ matrix.os }} (go ${{ matrix.go }})
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- id: config
uses: protocol/.github/.github/actions/read-config@master
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Go information
run: |
go version
go env
- name: Use msys2 on windows
if: matrix.os == 'windows'
shell: bash
# The executable for msys2 is also called bash.cmd
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md#shells
# If we prepend its location to the PATH
# subsequent 'shell: bash' steps will use msys2 instead of gitbash
run: echo "C:/msys64/usr/bin" >> $GITHUB_PATH
- name: Run repo-specific setup
uses: ./.github/actions/go-test-setup
if: hashFiles('./.github/actions/go-test-setup') != ''
- name: Run tests
if: contains(fromJSON(steps.config.outputs.json).skipOSes, matrix.os) == false
uses: protocol/multiple-go-modules@v1.2
with:
# Use -coverpkg=./..., so that we include cross-package coverage.
# If package ./A imports ./B, and ./A's tests also cover ./B,
# this means ./B's coverage will be significantly higher than 0%.
run: go test -v -shuffle=on -coverprofile=module-coverage.txt -coverpkg=./... ./...
- name: Run tests (32 bit)
# can't run 32 bit tests on OSX.
if: matrix.os != 'macos' &&
fromJSON(steps.config.outputs.json).skip32bit != true &&
contains(fromJSON(steps.config.outputs.json).skipOSes, matrix.os) == false
uses: protocol/multiple-go-modules@v1.2
env:
GOARCH: 386
with:
run: |
export "PATH=$PATH_386:$PATH"
go test -v -shuffle=on ./...
- name: Run tests with race detector
# speed things up. Windows and OSX VMs are slow
if: matrix.os == 'ubuntu' &&
contains(fromJSON(steps.config.outputs.json).skipOSes, matrix.os) == false
uses: protocol/multiple-go-modules@v1.2
with:
run: go test -v -race ./...
- name: Collect coverage files
shell: bash
run: echo "COVERAGES=$(find . -type f -name 'module-coverage.txt' | tr -s '\n' ',' | sed 's/,$//')" >> $GITHUB_ENV
- name: Upload coverage to Codecov
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
with:
files: '${{ env.COVERAGES }}'
env_vars: OS=${{ matrix.os }}, GO=${{ matrix.go }}

View File

@@ -1,13 +1,19 @@
# File managed by web3-bot. DO NOT EDIT.
# See https://github.com/protocol/.github/ for details.
name: Release Checker name: Release Checker
on: on:
pull_request_target: pull_request_target:
paths: [ 'version.json' ] paths: [ 'version.json' ]
types: [ opened, synchronize, reopened, labeled, unlabeled ]
workflow_dispatch:
permissions:
contents: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
release-check: release-check:
uses: protocol/.github/.github/workflows/release-check.yml@master uses: ipdxco/unified-github-workflows/.github/workflows/release-check.yml@v1.0
with:
go-version: 1.20.x

View File

@@ -1,11 +1,17 @@
# File managed by web3-bot. DO NOT EDIT.
# See https://github.com/protocol/.github/ for details.
name: Releaser name: Releaser
on: on:
push: push:
paths: [ 'version.json' ] paths: [ 'version.json' ]
workflow_dispatch:
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.sha }}
cancel-in-progress: true
jobs: jobs:
releaser: releaser:
uses: protocol/.github/.github/workflows/releaser.yml@master uses: ipdxco/unified-github-workflows/.github/workflows/releaser.yml@v1.0

View File

@@ -1,26 +1,14 @@
name: Close and mark stale issue name: Close Stale Issues
on: on:
schedule: schedule:
- cron: '0 0 * * *' - cron: '0 0 * * *'
workflow_dispatch:
jobs:
stale:
runs-on: ubuntu-latest
permissions: permissions:
issues: write issues: write
pull-requests: write pull-requests: write
steps: jobs:
- uses: actions/stale@v3 stale:
with: uses: ipdxco/unified-github-workflows/.github/workflows/reusable-stale-issue.yml@v1
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days.'
close-issue-message: 'This issue was closed because it is missing author input.'
stale-issue-label: 'kind/stale'
any-of-labels: 'need/author-input'
exempt-issue-labels: 'need/triage,need/community-input,need/maintainer-input,need/maintainers-input,need/analysis,status/blocked,status/in-progress,status/ready,status/deferred,status/inactive'
days-before-issue-stale: 6
days-before-issue-close: 7
enable-statistics: true

View File

@@ -1,12 +1,18 @@
# File managed by web3-bot. DO NOT EDIT.
# See https://github.com/protocol/.github/ for details.
name: Tag Push Checker name: Tag Push Checker
on: on:
push: push:
tags: tags:
- v* - v*
permissions:
contents: read
issues: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
releaser: releaser:
uses: protocol/.github/.github/workflows/tagpush.yml@master uses: ipdxco/unified-github-workflows/.github/workflows/tagpush.yml@v1.0

View File

@@ -5,7 +5,7 @@ go-cid
[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/) [![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/)
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) [![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
[![](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme) [![](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
[![GoDoc](https://godoc.org/github.com/ipfs/go-cid?status.svg)](https://godoc.org/github.com/ipfs/go-cid) [![GoDoc](https://godoc.org/code.sonr.org/go/cid?status.svg)](https://godoc.org/code.sonr.org/go/cid)
[![Coverage Status](https://coveralls.io/repos/github/ipfs/go-cid/badge.svg?branch=master)](https://coveralls.io/github/ipfs/go-cid?branch=master) [![Coverage Status](https://coveralls.io/repos/github/ipfs/go-cid/badge.svg?branch=master)](https://coveralls.io/github/ipfs/go-cid?branch=master)
[![Travis CI](https://travis-ci.org/ipfs/go-cid.svg?branch=master)](https://travis-ci.org/ipfs/go-cid) [![Travis CI](https://travis-ci.org/ipfs/go-cid.svg?branch=master)](https://travis-ci.org/ipfs/go-cid)
@@ -31,7 +31,7 @@ It is used in `go-ipfs` and related packages to refer to a typed hunk of data.
`go-cid` is a standard Go module which can be installed with: `go-cid` is a standard Go module which can be installed with:
```sh ```sh
go get github.com/ipfs/go-cid go get code.sonr.org/go/cid
``` ```
## Usage ## Usage
@@ -61,7 +61,7 @@ fmt.Println("Got CID: ", c)
```go ```go
import ( import (
cid "github.com/ipfs/go-cid" cid "code.sonr.org/go/cid"
mc "github.com/multiformats/go-multicodec" mc "github.com/multiformats/go-multicodec"
mh "github.com/multiformats/go-multihash" mh "github.com/multiformats/go-multihash"
) )

View File

@@ -4,7 +4,7 @@ import (
"math/rand" "math/rand"
"testing" "testing"
"github.com/ipfs/go-cid" "code.sonr.org/go/cid"
"github.com/multiformats/go-multihash" "github.com/multiformats/go-multihash"
) )

2
cid.go
View File

@@ -70,7 +70,7 @@ var (
) )
// Consts below are DEPRECATED and left only for legacy reasons: // Consts below are DEPRECATED and left only for legacy reasons:
// <https://github.com/ipfs/go-cid/pull/137> // <https://code.sonr.org/go/cid/pull/137>
// Modern code should use consts from go-multicodec instead: // Modern code should use consts from go-multicodec instead:
// <https://github.com/multiformats/go-multicodec> // <https://github.com/multiformats/go-multicodec>
const ( const (

View File

@@ -33,7 +33,7 @@ func assertEqual(t *testing.T, a, b Cid) {
func TestPrefixSum(t *testing.T) { func TestPrefixSum(t *testing.T) {
// Test creating CIDs both manually and with Prefix. // Test creating CIDs both manually and with Prefix.
// Tests: https://github.com/ipfs/go-cid/issues/83 // Tests: https://code.sonr.org/go/cid/issues/83
for _, hashfun := range []uint64{ for _, hashfun := range []uint64{
mh.IDENTITY, mh.SHA3, mh.SHA2_256, mh.IDENTITY, mh.SHA3, mh.SHA2_256,
} { } {

12
go.mod
View File

@@ -1,9 +1,9 @@
module github.com/ipfs/go-cid module code.sonr.org/go/cid
require ( require (
github.com/multiformats/go-multibase v0.2.0 github.com/multiformats/go-multibase v0.2.0
github.com/multiformats/go-multihash v0.2.1 github.com/multiformats/go-multihash v0.2.3
github.com/multiformats/go-varint v0.0.7 github.com/multiformats/go-varint v0.1.0
) )
require ( require (
@@ -13,9 +13,9 @@ require (
github.com/multiformats/go-base32 v0.0.3 // indirect github.com/multiformats/go-base32 v0.0.3 // indirect
github.com/multiformats/go-base36 v0.1.0 // indirect github.com/multiformats/go-base36 v0.1.0 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect
golang.org/x/crypto v0.1.0 // indirect golang.org/x/crypto v0.45.0 // indirect
golang.org/x/sys v0.1.0 // indirect golang.org/x/sys v0.38.0 // indirect
lukechampine.com/blake3 v1.1.6 // indirect lukechampine.com/blake3 v1.1.6 // indirect
) )
go 1.19 go 1.24.0

16
go.sum
View File

@@ -11,15 +11,15 @@ github.com/multiformats/go-base36 v0.1.0 h1:JR6TyF7JjGd3m6FbLU2cOxhC0Li8z8dLNGQ8
github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM= github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM=
github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g= github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g=
github.com/multiformats/go-multibase v0.2.0/go.mod h1:bFBZX4lKCA/2lyOFSAoKH5SS6oPyjtnzK/XTFDPkNuk= github.com/multiformats/go-multibase v0.2.0/go.mod h1:bFBZX4lKCA/2lyOFSAoKH5SS6oPyjtnzK/XTFDPkNuk=
github.com/multiformats/go-multihash v0.2.1 h1:aem8ZT0VA2nCHHk7bPJ1BjUbHNciqZC/d16Vve9l108= github.com/multiformats/go-multihash v0.2.3 h1:7Lyc8XfX/IY2jWb/gI7JP+o7JEq9hOa7BFvVU9RSh+U=
github.com/multiformats/go-multihash v0.2.1/go.mod h1:WxoMcYG85AZVQUyRyo9s4wULvW5qrI9vb2Lt6evduFc= github.com/multiformats/go-multihash v0.2.3/go.mod h1:dXgKXCXjBzdscBLk9JkjINiEsCKRVch90MdaGiKsvSM=
github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8= github.com/multiformats/go-varint v0.1.0 h1:i2wqFp4sdl3IcIxfAonHQV9qU5OsZ4Ts9IOoETFs5dI=
github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= github.com/multiformats/go-varint v0.1.0/go.mod h1:5KVAVXegtfmNQQm/lCY+ATvDzvJJhSkUlGQV9wgObdI=
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q=
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4=
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
lukechampine.com/blake3 v1.1.6 h1:H3cROdztr7RCfoaTpGZFQsrqvweFLrqS73j7L7cmR5c= lukechampine.com/blake3 v1.1.6 h1:H3cROdztr7RCfoaTpGZFQsrqvweFLrqS73j7L7cmR5c=
lukechampine.com/blake3 v1.1.6/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= lukechampine.com/blake3 v1.1.6/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA=

View File

@@ -1,3 +1,3 @@
{ {
"version": "v0.4.1" "version": "v0.6.0"
} }