{"id":22911999,"url":"https://github.com/opencoff/go-cdb","last_synced_at":"2025-08-24T06:42:40.836Z","repository":{"id":57557758,"uuid":"123346927","full_name":"opencoff/go-cdb","owner":"opencoff","description":"DJB's Constant DB - with changes to add sha256 checksum to the generated DB","archived":false,"fork":false,"pushed_at":"2018-02-28T22:09:21.000Z","size":9,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T11:08:57.775Z","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/opencoff.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":"2018-02-28T21:53:11.000Z","updated_at":"2023-12-21T12:25:05.000Z","dependencies_parsed_at":"2022-08-28T11:41:43.278Z","dependency_job_id":null,"html_url":"https://github.com/opencoff/go-cdb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/opencoff/go-cdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencoff%2Fgo-cdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencoff%2Fgo-cdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencoff%2Fgo-cdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencoff%2Fgo-cdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opencoff","download_url":"https://codeload.github.com/opencoff/go-cdb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencoff%2Fgo-cdb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271809347,"owners_count":24825698,"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","status":"online","status_checked_at":"2025-08-24T02:00:11.135Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-12-14T04:19:31.703Z","updated_at":"2025-08-24T06:42:40.082Z","avatar_url":"https://github.com/opencoff.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"CDB\n===\n\n[![GoDoc](https://godoc.org/github.com/colinmarc/cdb/web?status.svg)](https://godoc.org/github.com/colinmarc/cdb) [![build](https://travis-ci.org/colinmarc/cdb.svg?branch=master)](https://travis-ci.org/colinmarc/hdfs)\n\nThis is a native Go implementation of [cdb][1], a constant key/value database\nwith some very nice properties. From the [design doc][1]:\n\n\u003e cdb is a fast, reliable, simple package for creating and reading constant databases. Its database structure provides several features:\n\u003e - Fast lookups: A successful lookup in a large database normally takes just two disk accesses. An unsuccessful lookup takes only one.\n\u003e - Low overhead: A database uses 2048 bytes, plus 24 bytes per record, plus the space for keys and data.\n\u003e - No random limits: cdb can handle any database up to 4 gigabytes. There are no other restrictions; records don't even have to fit into memory. Databases are stored in a machine-independent format.\n\nThis version is modified by Sudhi Herle:\n\n- addition of a SHA256 checksum over the entire CDB (appended to end\n  of file) and verified when opened\n\n- uses Zi Long Tan's superfast hash\n\n[1]: http://cr.yp.to/cdb.html\n\nUsage\n-----\n\n```go\nwriter, err := cdb.Create(\"/tmp/example.cdb\")\nif err != nil {\n  log.Fatal(err)\n}\n\n// Write some key/value pairs to the database.\nwriter.Put([]byte(\"Alice\"), []byte(\"Practice\"))\nwriter.Put([]byte(\"Bob\"), []byte(\"Hope\"))\nwriter.Put([]byte(\"Charlie\"), []byte(\"Horse\"))\n\n// Freeze the database, and open it for reads.\ndb, err := writer.Freeze()\nif err != nil {\n  log.Fatal(err)\n}\n\n// Fetch a value.\nv, err := db.Get([]byte(\"Alice\"))\nif err != nil {\n  log.Fatal(err)\n}\n\nlog.Println(string(v))\n// =\u003e Practice\n\n// Iterate over the database\niter := db.Iter()\nfor iter.Next() {\n    log.Printf(\"The key %s has a value of length %d\\n\", string(iter.Key()), len(iter.Value()))\n}\n\nif err := iter.Err(); err != nil {\n    log.Fatal(err)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopencoff%2Fgo-cdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopencoff%2Fgo-cdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopencoff%2Fgo-cdb/lists"}