{"id":19509572,"url":"https://github.com/raspi/searchreader","last_synced_at":"2026-05-28T16:31:31.119Z","repository":{"id":65163476,"uuid":"583498254","full_name":"raspi/searchreader","owner":"raspi","description":"Search single bytes.Reader with multiple strings.Readers with or without case sensitivity","archived":false,"fork":false,"pushed_at":"2023-01-04T13:13:27.000Z","size":28,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-25T22:46:35.659Z","etag":null,"topics":["binary","bytes","case-sensitive","case-sensitivity","find","go","golang","library","reader","search","stream","string","text"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raspi.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":"2022-12-30T00:39:29.000Z","updated_at":"2023-01-06T21:08:41.000Z","dependencies_parsed_at":"2023-01-05T05:04:59.062Z","dependency_job_id":null,"html_url":"https://github.com/raspi/searchreader","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/raspi/searchreader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspi%2Fsearchreader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspi%2Fsearchreader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspi%2Fsearchreader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspi%2Fsearchreader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raspi","download_url":"https://codeload.github.com/raspi/searchreader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspi%2Fsearchreader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33617718,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"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":["binary","bytes","case-sensitive","case-sensitivity","find","go","golang","library","reader","search","stream","string","text"],"created_at":"2024-11-10T23:12:32.846Z","updated_at":"2026-05-28T16:31:31.103Z","avatar_url":"https://github.com/raspi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# searchreader\n\n![GitHub All Releases](https://img.shields.io/github/downloads/raspi/searchreader/total?style=for-the-badge)\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/raspi/searchreader?style=for-the-badge)\n![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/raspi/searchreader?style=for-the-badge)\n[![Go Report Card](https://goreportcard.com/badge/github.com/raspi/searchreader)](https://goreportcard.com/report/github.com/raspi/searchreader)\n\nSearch single `bytes.Reader` with different `strings.Reader`(s) containing the search byte(s) or string(s).\n\nPart of [heksa issue](https://github.com/raspi/heksa/issues/8).\n\n```go\nfunc main() {\n\n\t// Source\n\tsrc := bytes.NewReader(\n\t\t[]byte(\"heLLo, world!\\000\\000\"),\n\t)\n\n\t// What to search\n\tsearch1 := strings.NewReader(\"\\000\")\n\tsearch2 := strings.NewReader(`ll`)\n\n\tsr := searchreader.New(src,\n\t\tsearchreader.WithCaseSensitive(search1),\n\t\tsearchreader.WithCaseInsensitive(search2),\n\t)\n\n\tbuffer := make([]byte, 1024)\n\n\t_, results, err := sr.Read(buffer)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor _, result := range results {\n\t\tfmt.Printf(`found match at position %d that matches search%d %d`+\"\\n\", result.StartPosition, 1+result.Index, result.Length)\n\t}\n\n}\n```\n\nOutputs:\n\n```\nfound match at position 2 that matches search2 2\nfound match at position 13 that matches search1 1\nfound match at position 14 that matches search1 1\n```\n\n## Some goals\n\n* Convert searched string(s) into different encodings such as UTF-8, ISO-8859-1 and ISO-8859-15 so that you can search more efficiently at once\n\n## Is it any good?\n\nYes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraspi%2Fsearchreader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraspi%2Fsearchreader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraspi%2Fsearchreader/lists"}