{"id":21947743,"url":"https://github.com/valpackett/go-base64-simd","last_synced_at":"2026-04-29T14:04:53.347Z","repository":{"id":57511953,"uuid":"107319021","full_name":"valpackett/go-base64-simd","owner":"valpackett","description":"SIMD accelerated Base64 for Go","archived":false,"fork":false,"pushed_at":"2017-10-29T23:27:55.000Z","size":60,"stargazers_count":18,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-12T15:38:27.452Z","etag":null,"topics":["base64","go","golang","simd"],"latest_commit_sha":null,"homepage":"","language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/valpackett.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-17T20:15:02.000Z","updated_at":"2024-12-04T22:28:35.000Z","dependencies_parsed_at":"2022-08-29T05:21:11.087Z","dependency_job_id":null,"html_url":"https://github.com/valpackett/go-base64-simd","commit_stats":null,"previous_names":["myfreeweb/go-base64-simd","unrelentingtech/go-base64-simd"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/valpackett/go-base64-simd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valpackett%2Fgo-base64-simd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valpackett%2Fgo-base64-simd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valpackett%2Fgo-base64-simd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valpackett%2Fgo-base64-simd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/valpackett","download_url":"https://codeload.github.com/valpackett/go-base64-simd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valpackett%2Fgo-base64-simd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32428622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T13:34:34.882Z","status":"ssl_error","status_checked_at":"2026-04-29T13:34:29.830Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["base64","go","golang","simd"],"created_at":"2024-11-29T05:09:30.944Z","updated_at":"2026-04-29T14:04:53.311Z","avatar_url":"https://github.com/valpackett.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-base64-simd\n\nA nearly drop-in replacement for [Go's slow-ass base64 implementation](https://github.com/golang/go/issues/19636), using [aklomp/base64, an awesome SIMD-accelerated library](https://github.com/aklomp/base64).\n\nHowever, it does not skip whitespace and other junk characters!\n`SkipPrepass` is provided to deal with that, but it slows everything down.\n(Still up to 2x as fast as the standard library.)\n\n```\nAMD Ryzen 7 1700 @ 3.9 GHz (AVX2)\ngo 1.9.1, FreeBSD 12-CURRENT\nBenchmarkEncodeStdlib-16                           1000000  1600 ns/op  1279.65 MB/s\nBenchmarkEncodeSIMD-16                             5000000   321 ns/op  6361.63 MB/s\nBenchmarkDecodeStdlib-16                            200000  6499 ns/op   315.10 MB/s\nBenchmarkDecodeSIMD-16                             3000000   455 ns/op  4500.07 MB/s\nBenchmarkDecodeSIMDWithSkipPrepassNoSpace-16        500000  2850 ns/op   718.45 MB/s\nBenchmarkDecodeSIMDWithSkipPrepassLineWrapped-16    300000  5432 ns/op   509.20 MB/s\n```\n\n```\nIntel Xeon E3-1220 @ 3.10GHz (AVX)\ngo 1.8.3, Linux 3.10.0\nBenchmarkEncodeStdlib-4                             500000  2474 ns/op   827.64 MB/s\nBenchmarkEncodeSIMD-4                              3000000   481 ns/op  4257.22 MB/s\nBenchmarkDecodeStdlib-4                             100000 13995 ns/op   146.33 MB/s\nBenchmarkDecodeSIMD-4                              3000000   531 ns/op  3851.89 MB/s\nBenchmarkDecodeSIMDWithSkipPrepassNoSpace-4         200000  6913 ns/op   296.23 MB/s\nBenchmarkDecodeSIMDWithSkipPrepassLineWrapped-4     200000  9869 ns/op   280.26 MB/s\n```\n\n## Internals\n\nThis should use assembly but currently uses cgo.\n\nInitially I attempted to use the terrible yet amazing [c2goasm](https://github.com/minio/c2goasm) hack.\nIt does not support global array constants.\nI've tried to bolt that on, but couldn't figure out how to express addressing like `mov al, byte ptr [rax + base64_table_enc]` in Go's horrific assembly syntax.\n\nThen I've discovered the `.syso` thing where you can link to objects assembled by a reasonable assembler.\nGave up fighting the crashes that came with that approach, using cgo for now, but still with the `.syso` file.\n\n## License\n\nBSD, like the original aklomp/base64 C library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalpackett%2Fgo-base64-simd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalpackett%2Fgo-base64-simd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalpackett%2Fgo-base64-simd/lists"}