{"id":37224870,"url":"https://github.com/everlastingbeta/strand","last_synced_at":"2026-01-15T01:44:17.599Z","repository":{"id":35441367,"uuid":"217720836","full_name":"everlastingbeta/strand","owner":"everlastingbeta","description":"Golang library for creating cryptographic and seeded pseudorandom bytes and strings","archived":false,"fork":false,"pushed_at":"2025-12-03T14:01:17.000Z","size":82,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-04T17:39:13.327Z","etag":null,"topics":["bytes","golang","library","pseudo-random-generator","strings"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/everlastingbeta.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-10-26T14:28:45.000Z","updated_at":"2025-12-02T01:56:27.000Z","dependencies_parsed_at":"2023-02-12T23:45:57.008Z","dependency_job_id":"b2e85f70-5a33-4595-b436-2e2af881e292","html_url":"https://github.com/everlastingbeta/strand","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/everlastingbeta/strand","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/everlastingbeta%2Fstrand","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/everlastingbeta%2Fstrand/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/everlastingbeta%2Fstrand/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/everlastingbeta%2Fstrand/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/everlastingbeta","download_url":"https://codeload.github.com/everlastingbeta/strand/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/everlastingbeta%2Fstrand/sbom","scorecard":{"id":386484,"data":{"date":"2025-08-11","repo":{"name":"github.com/everlastingbeta/strand","commit":"163c558991dd5c06b3e43d74f393d82fd13927d6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.1,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/4 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/golangci-lint.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/everlastingbeta/strand/golangci-lint.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/golangci-lint.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/everlastingbeta/strand/golangci-lint.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/everlastingbeta/strand/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/everlastingbeta/strand/test.yml/main?enable=pin","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/golangci-lint.yml:1","Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":10,"reason":"project is fuzzed","details":["Info: GoBuiltInFuzzer integration found: fuzzing_test.go:14","Info: GoBuiltInFuzzer integration found: fuzzing_test.go:63","Info: GoBuiltInFuzzer integration found: fuzzing_test.go:102"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 26 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T16:46:11.814Z","repository_id":35441367,"created_at":"2025-08-18T16:46:11.814Z","updated_at":"2025-08-18T16:46:11.814Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28441031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T00:55:22.719Z","status":"ssl_error","status_checked_at":"2026-01-15T00:55:20.945Z","response_time":107,"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":["bytes","golang","library","pseudo-random-generator","strings"],"created_at":"2026-01-15T01:44:17.107Z","updated_at":"2026-01-15T01:44:17.584Z","avatar_url":"https://github.com/everlastingbeta.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# strand\n\nA lightweight, powerful Golang library for generating random strings with both cryptographically secure and seeded options.\n\n[![PkgGoDev](https://pkg.go.dev/badge/everlastingbeta/strand)](https://pkg.go.dev/github.com/everlastingbeta/strand)\n[![Go Report Card](https://goreportcard.com/badge/everlastingbeta/strand?style=flat-square)](https://goreportcard.com/report/everlastingbeta/strand)\n![test](https://github.com/everlastingbeta/strand/workflows/test/badge.svg)\n![golangci-lint](https://github.com/everlastingbeta/strand/workflows/golangci-lint/badge.svg)\n\n## Features\n\n- Generate cryptographically secure random strings using `crypto/rand`\n- Create deterministic random strings with custom seeds using `math/rand/v2`\n- Context-aware functions for cancellation support\n- Predefined character sets for common use cases\n- Simple, clean API with both error-returning and panic-on-error versions\n\n## Installation\n\n```sh\ngo get -u github.com/everlastingbeta/strand\n```\n\n## Quick Start\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"github.com/everlastingbeta/strand\"\n)\n\nfunc main() {\n    // Generate a secure random string with uppercase letters\n    token, err := strand.String(16, strand.UppercaseAlphabet)\n    if err != nil {\n        panic(err)\n    }\n    fmt.Println(\"Secure token:\", token)\n\n    // Generate a predictable string with a custom charset and seed\n    password := strand.SeededString(12, strand.ALL, 42)\n    fmt.Println(\"Deterministic password:\", password)\n}\n```\n\n## Usage Examples\n\n### Cryptographically Secure Random Generation\n\nUse these functions for security-sensitive applications like tokens, passwords, and API keys.\n\n```go\n// Generate a secure random byte slice with alphanumeric characters\nbytes, err := strand.Bytes(12, strand.AlphaNumeric)\nif err != nil {\n    // Handle error\n}\nfmt.Printf(\"Random bytes: %v\\n\", bytes)\n\n// Generate a secure random string with custom character set\napiKey, err := strand.String(32, strand.AlphaNumeric + \"-_\")\nif err != nil {\n    // Handle error\n}\nfmt.Println(\"API key:\", apiKey)\n\n// Non-error-returning versions (will panic on error)\ntoken := strand.MustString(16, strand.ALL)\nfmt.Println(\"Secure token:\", token)\n```\n\n### Deterministic Random Generation\n\nUse these functions when you need reproducible results with a specific seed.\n\n```go\n// Generate a random byte slice with a timestamp-based seed\nbytes := strand.SeededBytes(8, strand.Numbers)\nfmt.Printf(\"Seeded bytes: %v\\n\", bytes)\n\n// Generate a random string with a custom seed and charset\nid := strand.SeededString(10, \"ACDEFGHJKLMNPQRSTUVWXYZ23456789\", 12345)\nfmt.Println(\"Deterministic ID:\", id)\n```\n\n### Context-Aware Functions\n\nFor operations that might need to be canceled or have timeouts.\n\n```go\nimport (\n    \"context\"\n    \"time\"\n)\n\n// Create a context with timeout\nctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\ndefer cancel()\n\n// Generate random strings with context support\nresult, err := strand.StringWithContext(ctx, 20, strand.ALL)\nif err != nil {\n    // Handle context cancellation or other errors\n}\n\n// Also available for seeded versions\nseededResult, err := strand.SeededStringWithContext(ctx, 20, strand.AlphaNumeric, 42)\nif err != nil {\n    // Handle errors\n}\n```\n\n## Available Character Sets\n\nStrand provides several predefined character sets for convenience:\n\n| Constant | Description |\n|----------|-------------|\n| `UppercaseAlphabet` | Uppercase letters (A-Z) |\n| `LowercaseAlphabet` | Lowercase letters (a-z) |\n| `Alphabet` | All letters (a-z, A-Z) |\n| `Numbers` | Digits (0-9) |\n| `AlphaNumeric` | All letters and digits |\n| `Symbols` | Common special characters |\n| `ALL` | All alphanumeric characters and symbols |\n\nYou can also define your own custom character sets as strings.\n\n## Security Considerations\n\n- The `Bytes()` and `String()` functions use `crypto/rand` and are suitable for security-sensitive applications.\n- The `SeededBytes()` and `SeededString()` functions use `math/rand/v2` and are NOT cryptographically secure. Use them only when predictable output is required.\n\n## License\n\n[MIT](https://github.com/everlastingbeta/strand/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feverlastingbeta%2Fstrand","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feverlastingbeta%2Fstrand","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feverlastingbeta%2Fstrand/lists"}