{"id":48332678,"url":"https://github.com/toolmanorg/numbers-stdsize","last_synced_at":"2026-04-05T01:09:54.345Z","repository":{"id":57502165,"uuid":"136955405","full_name":"toolmanorg/numbers-stdsize","owner":"toolmanorg","description":"Parse / Display Human Readable Standard Sizes","archived":false,"fork":false,"pushed_at":"2024-01-30T15:33:06.000Z","size":27,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-15T09:21:56.481Z","etag":null,"topics":["golang","golang-library","human-readable","si-units"],"latest_commit_sha":null,"homepage":"","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/toolmanorg.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}},"created_at":"2018-06-11T16:52:40.000Z","updated_at":"2024-01-30T15:33:10.000Z","dependencies_parsed_at":"2024-06-20T07:31:13.949Z","dependency_job_id":null,"html_url":"https://github.com/toolmanorg/numbers-stdsize","commit_stats":{"total_commits":10,"total_committers":2,"mean_commits":5.0,"dds":0.09999999999999998,"last_synced_commit":"f26039c210c7355b771fcbbf0ac44244844eeb3d"},"previous_names":["tep/numbers-stdsize"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/toolmanorg/numbers-stdsize","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toolmanorg%2Fnumbers-stdsize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toolmanorg%2Fnumbers-stdsize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toolmanorg%2Fnumbers-stdsize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toolmanorg%2Fnumbers-stdsize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toolmanorg","download_url":"https://codeload.github.com/toolmanorg/numbers-stdsize/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toolmanorg%2Fnumbers-stdsize/sbom","scorecard":{"id":894294,"data":{"date":"2025-08-11","repo":{"name":"github.com/toolmanorg/numbers-stdsize","commit":"bc1455255dca094e9e3384837685b8d50b73f81d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/11 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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"Maintained","score":0,"reason":"0 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":-1,"reason":"no workflows found","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":"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":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"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":"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":"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":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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"}}]},"last_synced_at":"2025-08-24T13:05:13.009Z","repository_id":57502165,"created_at":"2025-08-24T13:05:13.009Z","updated_at":"2025-08-24T13:05:13.009Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31420789,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T00:25:07.052Z","status":"ssl_error","status_checked_at":"2026-04-05T00:25:05.923Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["golang","golang-library","human-readable","si-units"],"created_at":"2026-04-05T01:09:53.790Z","updated_at":"2026-04-05T01:09:54.336Z","avatar_url":"https://github.com/toolmanorg.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![GoDoc](https://godoc.org/toolman.org/numbers/stdsize?status.svg)](https://godoc.org/toolman.org/numbers/stdsize) [![Go Report Card](https://goreportcard.com/badge/toolman.org/numbers/stdsize)](https://goreportcard.com/report/toolman.org/numbers/stdsize) [![Build Status](https://travis-ci.org/toolmanorg/numbers-stdsize.svg?branch=master)](https://travis-ci.org/toolmanorg/numbers-stdsize)\n\n# stdsize\n`import \"toolman.org/numbers/stdsize\"`\n\n* [Overview](#pkg-overview)\n* [Install](#pkg-install)\n* [Index](#pkg-index)\n\n## \u003ca name=\"pkg-overview\"\u003eOverview\u003c/a\u003e\nPackage stdsize provides the integer type \"Value\" that may be created\nor displayed using human-readable strings.  For example, \"2Ki\" gets\nparsed as 2048 while the numeric value of 5\\*1000\\*1000 (i.e. 5 million)\nis displayed as \"5M\".\n\n## \u003ca name=\"pkg-install\"\u003eInstall\u003c/a\u003e\n\n``` sh\n  go get toolman.org/numbers/stdsize\n```\n\n## \u003ca name=\"pkg-index\"\u003eIndex\u003c/a\u003e\n* [Variables](#pkg-variables)\n* [type Value](#Value)\n  * [func Parse(s string) (Value, error)](#Parse)\n  * [func ParseBinary(s string) (Value, error)](#ParseBinary)\n  * [func (v Value) Format(f fmt.State, c rune)](#Value.Format)\n\n\n#### \u003ca name=\"pkg-files\"\u003ePackage files\u003c/a\u003e\n[format.go](/src/toolman.org/numbers/stdsize/format.go) [parse.go](/src/toolman.org/numbers/stdsize/parse.go) [parts.go](/src/toolman.org/numbers/stdsize/parts.go) [units.go](/src/toolman.org/numbers/stdsize/units.go) [value.go](/src/toolman.org/numbers/stdsize/value.go) \n\n\n## \u003ca name=\"pkg-variables\"\u003eVariables\u003c/a\u003e\n``` go\nvar (\n    // ErrBadModifier is returned by Parse and ParseBinary if the\n    // given size modifier is unrecognized.\n    ErrBadModifier = errors.New(\"invalid size modifier\")\n\n    // ErrNotInteger is returned by Parse and ParseBinary if no\n    // size modifier is provided and the given numeric value is\n    // not an integer.\n    ErrNotInteger = errors.New(\"bare size values must be integers\")\n)\n```\n\n## \u003ca name=\"Value\"\u003etype\u003c/a\u003e [Value](/src/target/value.go?s=1156:1172#L16)\n``` go\ntype Value int64\n```\nValue is a standard size value as returned by Parse or ParseBinary. It also\nprovides a custom formatter for displaying human-readable values.\n\n\n``` go\nconst (\n    Kilo Value = 1000        // 10^3\n    Mega Value = Kilo * Kilo // 10^6\n    Giga Value = Mega * Kilo // 10^9\n    Tera Value = Giga * Kilo // 10^12\n    Peta Value = Tera * Kilo // 10^15\n)\n```\nConstants for common decimal (i.e. power of 10) values.\n\n\n``` go\nconst (\n    Kibi Value = 1 \u003c\u003c (10 * (iota + 1)) // 2^10\n    Mibi                                // 2^20\n    Gibi                                // 2^30\n    Tebi                                // 2^40\n    Pebi                                // 2^50\n)\n```\nConstants for common binary (i.e. power of 2) values.\n\n### \u003ca name=\"Parse\"\u003efunc\u003c/a\u003e [Parse](/src/target/parse.go?s=1531:1566#L31)\n``` go\nfunc Parse(s string) (Value, error)\n```\nParse converts the size designation s to an integer Value. A size\ndesignation is specified as any (real) numeric value, either positive\nor negative, followed by a size modifier.\n\nThe following modifiers are supported:\n\n\n\tDecimal     Binary\n\t--------    --------\n\tK: 10^3     Ki: 2^10\n\tM: 10^6     Mi: 2^20\n\tG: 10^9     Gi: 2^30\n\tT: 10^12    Ti: 2^40\n\tP: 10^15    Pi: 2^50\n\nFor example, \"1K\" is 1000, \"1Ki\" is 1024, and \"2.5Ki\" is 2048 + 512 or 2560.\n\nIf no size modifier is provided then the numeric value must be an integer,\notherwise Parse returns ErrNotInteger.\n\nIf the given size modifier is unrecognized, Parse returns ErrBadModifier.\n\nIf the numeric value is unparsable, then Parse returns an error of type\n*strconv.NumError.\n\n\n### \u003ca name=\"ParseBinary\"\u003efunc\u003c/a\u003e [ParseBinary](/src/target/parse.go?s=1745:1786#L37)\n``` go\nfunc ParseBinary(s string) (Value, error)\n```\nParseBinary is similar to Parse except all size modifiers are assumed to be\nbinary. In other words, both \"K\" and \"Ki\" are interpreted as 2^10.\n\n\n### \u003ca name=\"Value.Format\"\u003efunc\u003c/a\u003e (Value) [Format](/src/target/format.go?s=907:949#L16)\n``` go\nfunc (v Value) Format(f fmt.State, c rune)\n```\nFormat implements fmt.Formatter to provide custom, printf style formatting\nfor Values. It is not intended to be called directly.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoolmanorg%2Fnumbers-stdsize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoolmanorg%2Fnumbers-stdsize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoolmanorg%2Fnumbers-stdsize/lists"}