{"id":19684254,"url":"https://github.com/elliotwutingfeng/asciiset","last_synced_at":"2025-04-29T06:30:26.201Z","repository":{"id":65146215,"uuid":"583435929","full_name":"elliotwutingfeng/asciiset","owner":"elliotwutingfeng","description":"asciiset is an ASCII character bitset.","archived":false,"fork":false,"pushed_at":"2024-02-14T02:51:58.000Z","size":107,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-02-14T03:29:39.964Z","etag":null,"topics":["ascii","bitmask","bitset","bitwise","byte","data-structures","hacktoberfest","set","string"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elliotwutingfeng.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-12-29T19:19:56.000Z","updated_at":"2023-10-16T18:27:03.000Z","dependencies_parsed_at":"2024-02-14T03:39:34.708Z","dependency_job_id":null,"html_url":"https://github.com/elliotwutingfeng/asciiset","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"1c2f724b0e91577fc2d83d6d6670f5274db7fdfa"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotwutingfeng%2Fasciiset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotwutingfeng%2Fasciiset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotwutingfeng%2Fasciiset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotwutingfeng%2Fasciiset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elliotwutingfeng","download_url":"https://codeload.github.com/elliotwutingfeng/asciiset/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224151082,"owners_count":17264436,"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":["ascii","bitmask","bitset","bitwise","byte","data-structures","hacktoberfest","set","string"],"created_at":"2024-11-11T18:17:19.049Z","updated_at":"2024-11-11T18:17:19.605Z","avatar_url":"https://github.com/elliotwutingfeng.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# asciiset\n\n[![Go Reference](https://img.shields.io/badge/go-reference-blue?logo=go\u0026logoColor=white\u0026style=for-the-badge)](https://pkg.go.dev/github.com/elliotwutingfeng/asciiset)\n[![Go Report Card](https://goreportcard.com/badge/github.com/elliotwutingfeng/asciiset?style=for-the-badge)](https://goreportcard.com/report/github.com/elliotwutingfeng/asciiset)\n[![Coveralls](https://img.shields.io/coverallsCoverage/github/elliotwutingfeng/asciiset?logo=coveralls\u0026style=for-the-badge)](https://coveralls.io/github/elliotwutingfeng/asciiset?branch=main)\n\n[![GitHub license](https://img.shields.io/badge/LICENSE-BSD--3--CLAUSE-GREEN?style=for-the-badge)](LICENSE)\n\n## Summary\n\n**asciiset** is an [ASCII](https://simple.wikipedia.org/wiki/ASCII) character bitset.\n\nBitsets are fast and memory-efficient data structures for storing and retrieving information using bitwise operations.\n\n**asciiset** is an extension of the **asciiSet** data structure from the Go Standard library [source code](https://cs.opensource.google/go/go/+/master:src/bytes/bytes.go).\n\nPossible applications include checking strings for prohibited ASCII characters, and counting unique ASCII characters in a string.\n\nSpot any bugs? Report them [here](https://github.com/elliotwutingfeng/asciiset/issues).\n\n![ASCII Table](ASCII-Table.svg)\n\n## Installation\n\n```bash\ngo get github.com/elliotwutingfeng/asciiset\n```\n\n## Testing\n\n```bash\nmake tests\n\n# Alternatively, run tests without race detection\n# Useful for systems that do not support the -race flag like windows/386\n# See https://tip.golang.org/src/cmd/dist/test.go\nmake tests_without_race\n```\n\n## Benchmarks\n\n```bash\nmake bench\n```\n\n### Results\n\n```text\nCPU: AMD Ryzen 7 5800X\nTime in nanoseconds (ns) | Lower is better\n\nASCIISet\n\n     Add() ▏  891 🟦🟦🟦 11x faster\n\nContains() ▏  580 🟦🟦 28x faster\n\n  Remove() ▏ 1570 🟦🟦🟦🟦 1.5x faster\n\n    Size() ▏  313 🟦 equivalent\n\n   Visit() ▏ 1421 🟦🟦🟦🟦 3.5x faster\n\nmap[byte]struct{}\n\n     Add() ▏ 9850 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥\n\nContains() ▏16605 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥\n\n  Remove() ▏ 2510 🟥🟥🟥🟥🟥🟥\n\n    Size() ▏  318 🟥\n\n   Visit() ▏ 5085 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥\n```\n\n```bash\ngo test -bench . -benchmem -cpu 1\ngoos: linux\ngoarch: amd64\npkg: github.com/elliotwutingfeng/asciiset\ncpu: AMD Ryzen 7 5800X 8-Core Processor\nBenchmarkASCIISet/ASCIISet_Add()                 1340958               891.8 ns/op             0 B/op          0 allocs/op\nBenchmarkASCIISet/ASCIISet_Contains()            2058140               580.9 ns/op             0 B/op          0 allocs/op\nBenchmarkASCIISet/ASCIISet_Remove()               762636              1570 ns/op               0 B/op          0 allocs/op\nBenchmarkASCIISet/ASCIISet_Size()                3808866               313.2 ns/op             0 B/op          0 allocs/op\nBenchmarkASCIISet/ASCIISet_Visit()                840808              1421 ns/op               0 B/op          0 allocs/op\nBenchmarkMapSet/map_Add                           122043              9850 ns/op               0 B/op          0 allocs/op\nBenchmarkMapSet/map_Contains                       72583             16605 ns/op               0 B/op          0 allocs/op\nBenchmarkMapSet/map_Remove                        451785              2510 ns/op               0 B/op          0 allocs/op\nBenchmarkMapSet/map_Size                         3789381               318.3 ns/op             0 B/op          0 allocs/op\nBenchmarkMapSet/map_Visit                         235515              5085 ns/op               0 B/op          0 allocs/op\nPASS\nok      github.com/elliotwutingfeng/asciiset    14.438s\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliotwutingfeng%2Fasciiset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felliotwutingfeng%2Fasciiset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliotwutingfeng%2Fasciiset/lists"}