{"id":17723361,"url":"https://github.com/afbjorklund/bsdsum","last_synced_at":"2026-05-18T14:38:45.931Z","repository":{"id":259281458,"uuid":"871538177","full_name":"afbjorklund/bsdsum","owner":"afbjorklund","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-10T22:03:39.000Z","size":419,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T23:27:42.284Z","etag":null,"topics":["blake3","keccak","macos","sha256"],"latest_commit_sha":null,"homepage":"","language":"C","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/afbjorklund.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-10-12T08:37:11.000Z","updated_at":"2025-03-10T20:15:48.000Z","dependencies_parsed_at":"2024-12-22T20:27:36.800Z","dependency_job_id":"030008c4-040f-4264-b5bc-ab3d6f0680ad","html_url":"https://github.com/afbjorklund/bsdsum","commit_stats":null,"previous_names":["afbjorklund/bsdsum"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afbjorklund%2Fbsdsum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afbjorklund%2Fbsdsum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afbjorklund%2Fbsdsum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afbjorklund%2Fbsdsum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afbjorklund","download_url":"https://codeload.github.com/afbjorklund/bsdsum/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246475855,"owners_count":20783738,"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":["blake3","keccak","macos","sha256"],"created_at":"2024-10-25T15:42:44.874Z","updated_at":"2025-10-27T10:36:07.228Z","avatar_url":"https://github.com/afbjorklund.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bsdsum\n\nAn updated version of the checksum program from FreeBSD and Darwin.\n\nAdding more algorithms, and more implementations (including Linux).\n\n## FreeBSD\n\nThis is the FreeBSD \"md5\" program, which also does other digests...\n\n`src/sbin/md5`\n\nIt uses libmd for the digests, the OpenBSD version is available:\n\n\u003chttps://www.hadrons.org/software/libmd/\u003e\n\n## Darwin\n\nIt is available on macOS (`/sbin`), but only `md5` has been linked.\n\n`text_cmds/md5`\n\nThere it uses CommonCrypto, which is a part of `libSystem.B.dylib`\n\n\u003chttps://opensource.apple.com/source/CommonCrypto/\u003e\n\n## Linux\n\nYou can also build this for Linux, where it uses openssl libcrypto.\n\n\u003chttps://www.openssl.org/\u003e\n\nBy setting `MD=true` you can use libmd for checking portability issues.\n\nIt is the default on FreeBSD, but optional on macOS and GNU/Linux.\n\n## Algorithms\n\nThese algorithms are available (enabled by default show in bold):\n\n- **md5**\n- **rmd160**\n- **sha1**\n- sha224\n- **sha256**\n- sha384\n- **sha512**\n- sha512t224\n- sha512t256\n- skein256\n- skein512\n- skein1024\n- keccak224\n- keccak256\n- keccak384\n- keccak512\n- **blake3**\n\n### SHA 123\n\nThe six functions `sha224` through `sha512t256` are all part of SHA-2.\u003cbr /\u003e\n[Skein](https://web.archive.org/web/20210401000151/http://www.skein-hash.info/)\nwas one of the SHA-3 proposals, but in the end it lost to [Keccak](https://keccak.team/).\n\nThe software implementations of SHA-3 are twice as slow as SHA-2, but\u003cbr /\u003e\nthe hardware implementations of SHA-3 are faster than SHA-1 and SHA-2.\n\nBy setting `S3=true` you can use the bundled \"libs3\" for SHA-3 support.\n\nThe default is to use libXKCP, which has both SIMD and generic version:\n\n\u003chttps://github.com/XKCP/XKCP\u003e\n\n### BLAKE 123\n\n[BLAKE3](https://blake3.io/) is based on [BLAKE2](https://blake2.net/),\nwhich is based on the SHA-3 proposal BLAKE.\n\nIt is faster in software, but yet no common implementations in hardware.\n\nBy setting `B3=true` you can use the bundled \"libb3\" for BLAKE3 support.\n\nThe default is to use libblake3, which has both SIMD and portable version:\n\n\u003chttps://github.com/BLAKE3-team/BLAKE3\u003e\n\n## Formats\n\nChecksums are normally shown in the full hexadecimal text format, not binary.\n\nThe two main formats are the BSD format with algorithm, and the GNU format:\n\n### BSD\n\n`sha256`\n\n```\nSHA256 (empty) = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\n```\n\n`blake3`\n\n```\nBLAKE3 (empty) = af1349b9f5f9a1a6a0404dea36dcc9499bcb25c9adc112b7cc9a93cae41f3262\n```\n\n### GNU\n\n`sha256sum`\n\n```\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855  empty\n```\n\n`blake3sum`\n\n```\naf1349b9f5f9a1a6a0404dea36dcc9499bcb25c9adc112b7cc9a93cae41f3262  empty\n```\n\nFor the GNU format, the algorithm to use is usually determined by file name.\n\nFiles can be compared against a string or (sum) file, using the `-c` option.\n\n### Any\n\nBy using the `-f` option, any types of checksum can be in the _same_ file:\n\n```\nsha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855  empty\nblake3:af1349b9f5f9a1a6a0404dea36dcc9499bcb25c9adc112b7cc9a93cae41f3262  empty\n```\n\nFor checking with the GNU tools, one need to filter and separate by colon:\n\nSomething like: `grep ^sha256 checksums.txt | cut -d: -f2 | sha256sum -c`\n\n## Benchmark\n\nComparing the algorithms on two machines, macOS `arm64` and Linux `amd64`.\n\nShowing both the portable MD (BSD) version, and the system CC or LC versions.\n\n![](assets/bsdsum-benchmark.png)\n\n`make benchmark` runs the built-in benchmark (the `-t` command line flag)\n\nNote that it uses a small test set: `Digesting 100000 10000-byte blocks`.\n\n## Timing\n\nComparing the time it takes to checksum the Ubuntu cloud image, 1 thread.\n\nThe fastest implementation is 10x faster is than the slowest (default).\n\n![](assets/bsdsum-timing.png)\n\nOn macOS you want to be using `sha256sum`, on Linux instead `blake3sum`.\n\nAssuming that macOS uses aarch64 (arm64), and Linux uses x86_64 (amd64).\n\n---\n\nhttps://www.freebsd.org/releases/\n\n| FreeBSD Version | Release Year          | Notes                       |\n|-----------------|-----------------------|-----------------------------|\n| 12.0            | 2018                  | Skein                       |\n| 10.0            | 2014                  | SHA-512                     |\n| 8.0             | 2009                  |                             |\n| 6.0             | 2005                  | Apple fork                  |\n\nhttps://opensource.apple.com/releases/\n\n| macOS Version   | text_cmds (md5)       | CommonCrypto (CommonDigest) |\n|-----------------|-----------------------|-----------------------------|\n| 12.1            | text_cmds-118         | CommonCrypto-60190          |\n| 11.1            | text_cmds-106         | CommonCrypto-60178.40.2     |\n| 10.15           | text_cmds-101.11.1    | CommonCrypto-60165          |\n| 10.10           | text_cmds-88          | CommonCrypto-60061          |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafbjorklund%2Fbsdsum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafbjorklund%2Fbsdsum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafbjorklund%2Fbsdsum/lists"}