Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrd0ll4r/bad-bits-cid-converter
Converts CIDs into the format expected by the bad bits denylist
https://github.com/mrd0ll4r/bad-bits-cid-converter
Last synced: 21 days ago
JSON representation
Converts CIDs into the format expected by the bad bits denylist
- Host: GitHub
- URL: https://github.com/mrd0ll4r/bad-bits-cid-converter
- Owner: mrd0ll4r
- License: mit
- Created: 2023-09-19T11:33:26.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-03-02T08:28:50.000Z (10 months ago)
- Last Synced: 2024-04-14T22:51:10.786Z (8 months ago)
- Language: Go
- Size: 26.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bad-bits-cid-converter
Converts CIDs and IPFS URIs to the format expected by the [bad bits denylist](https://badbits.dwebops.pub/).
## Building
On recent versions of go, build via
```
go build ./cmd/bad-bits-cid-converter/
```Alternatively, build within docker via
```
./build-in-docker.sh
```
The output will be placed in `out/`## Running
The tool reads lines from STDIN and writes converted results to STDOUT, together with the original.
Errors are written to STDERR and can be safely redirected.Input:
```/path
...
```Output:
```
...
```You can easily pipe data into it, like so:
```
cat | bad-bits-cid-converter 2>/dev/null | ...
```Input lines can be either
- blank CIDs, e.g. `Qm.....`
- IPFS URIs, e.g. `ipfs://Qm.../`
- CIDs with subdirectory paths, e.g. `Qm...//`
- Absolute IPFS paths, e.g. `/ipfs/Qm...//`They will be converted to `/`, SHA256 hashed, and hex-encoded.
The results can then be searched for in the [deny list](https://badbits.dwebops.pub/)
### Comparing to the deny list
You can download and prepare the deny list like so:
```
curl https://badbits.dwebops.pub/denylist.json | jq '.[].anchor' -r > deny-list.txt
```And then compare output from this tool like so:
```
cat | bad-bits-cid-converter 2>/dev/null | grep -F -f deny-list.txt
```## License
MIT, see [LICENSE](LICENSE).