{"id":17183415,"url":"https://github.com/geod24/bitblob","last_synced_at":"2026-02-03T04:30:53.387Z","repository":{"id":45556819,"uuid":"160801653","full_name":"Geod24/bitblob","owner":"Geod24","description":"A small value type to represent hashes","archived":false,"fork":false,"pushed_at":"2024-05-23T22:43:50.000Z","size":27,"stargazers_count":1,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"v2.x.x","last_synced_at":"2025-03-25T02:40:35.769Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"D","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/Geod24.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":"2018-12-07T09:26:44.000Z","updated_at":"2024-05-23T22:43:51.000Z","dependencies_parsed_at":"2025-03-25T02:39:44.376Z","dependency_job_id":"e2dc66b7-2183-4e2d-b480-7003d3f639ed","html_url":"https://github.com/Geod24/bitblob","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/Geod24/bitblob","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Geod24%2Fbitblob","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Geod24%2Fbitblob/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Geod24%2Fbitblob/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Geod24%2Fbitblob/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Geod24","download_url":"https://codeload.github.com/Geod24/bitblob/tar.gz/refs/heads/v2.x.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Geod24%2Fbitblob/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261304267,"owners_count":23138301,"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-10-15T00:40:32.119Z","updated_at":"2026-02-03T04:30:48.357Z","avatar_url":"https://github.com/Geod24.png","language":"D","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BitBlob\n\n[![DUB Package](https://img.shields.io/dub/v/bitblob.svg)](https://code.dlang.org/packages/bitblob)\n[![codecov](https://codecov.io/gh/Geod24/bitblob/branch/v1.x.x/graph/badge.svg)](https://codecov.io/gh/Geod24/bitblob)\n\nA lightweight wrapper to represent hashes as value types.\n\n## Example\n\n```D\n/// Alias for a 256 bits / 32 byte hash type\nalias Hash = BitBlob!32;\n\n/// Used in the following tests\nenum BTCGenesisStr = `0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f`;\n\n// Most functions are anotated as `nothrow`/`@nogc`/`pure`/`@safe`,\n// except for the two `toString` overloads\n@nogc @safe pure nothrow unittest\n{\n    import std.digest.sha;\n    // Can be initialized from an `ubyte[32]`\n    // (or `ubyte[]` of length 32)\n    const Hash fromSha = sha256Of(\"Hello World\");\n\n    // Or from a string\n    const Hash genesis = BTCGenesisStr;\n\n    assert(!genesis.isNull());\n    assert(Hash.init.isNull());\n\n    ubyte[5] empty;\n    assert(Hash.init \u003c genesis);\n    assert(genesis[0 .. 5] == empty);\n}\n\n// This cannot be nothrow/@nogc because format is not allocated as such\n// However, Bitblob has tests that it does not allocate\nunittest\n{\n    // This does not allocate\n    char[Hash.StringBufferSize] buff;\n    const Hash genesis = BTCGenesisStr;\n    formattedWrite(buff[], \"%s\", genesis);\n    assert(buff[] == BTCGenesisStr);\n}\n```\n\n## Note on design\n\n`BitBlob` is intended  for convenient representation\nof fully computed / finalized hashes.\n\nString representation, comparison, and seamless conversion\nfrom string or binary representation are the focus.\n\nByte-level manipulation of the underlying data is not\nprefered, although possible through `opSlice`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeod24%2Fbitblob","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeod24%2Fbitblob","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeod24%2Fbitblob/lists"}