{"id":13721329,"url":"https://github.com/juancarlospaco/nim-bytes2human","last_synced_at":"2025-03-21T20:16:35.754Z","repository":{"id":151515532,"uuid":"132124806","full_name":"juancarlospaco/nim-bytes2human","owner":"juancarlospaco","description":"Calculate all Byte units from integer bytes positive int64 with precision from Bytes to Yottabytes and return a human friendly string representation.","archived":false,"fork":false,"pushed_at":"2021-02-11T01:02:57.000Z","size":22,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-26T14:48:39.758Z","etag":null,"topics":["bytes","human","human-friendly","nim","nim-language"],"latest_commit_sha":null,"homepage":null,"language":"Nim","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juancarlospaco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"custom":"https://liberapay.com/juancarlospaco/donate"}},"created_at":"2018-05-04T10:17:29.000Z","updated_at":"2023-08-08T12:51:46.000Z","dependencies_parsed_at":"2023-05-18T21:45:38.467Z","dependency_job_id":null,"html_url":"https://github.com/juancarlospaco/nim-bytes2human","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juancarlospaco%2Fnim-bytes2human","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juancarlospaco%2Fnim-bytes2human/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juancarlospaco%2Fnim-bytes2human/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juancarlospaco%2Fnim-bytes2human/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juancarlospaco","download_url":"https://codeload.github.com/juancarlospaco/nim-bytes2human/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244860611,"owners_count":20522466,"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":["bytes","human","human-friendly","nim","nim-language"],"created_at":"2024-08-03T01:01:15.594Z","updated_at":"2025-03-21T20:16:35.727Z","avatar_url":"https://github.com/juancarlospaco.png","language":"Nim","funding_links":["https://liberapay.com/juancarlospaco/donate"],"categories":["Build Systems/Package Management"],"sub_categories":["Byte Size"],"readme":"# Nim-Bytes2Human\n\nCalculate all Byte units from integer bytes positive `int64`,\nwith precision from Bytes to Yottabytes, and return a human friendly string representation.\n\n- Works with `--gc:arc`, `--gc:orc`, `--panics:on`, `--experimental:strictFuncs`, C, C++, JavaScript.\n- Uses `system.nim` only, does not import anything from stdlib. Good performance.\n\n\n# Use\n\n```nim\n\u003e\u003e\u003e import bytes2human\n\u003e\u003e\u003e echo bytes2human(2398345659434540923)  # 2 Exabytes.\n(human: \"2 Exabytes 82 Petabytes 162 Terabytes 686 Gigabytes 371 Megabytes 136 Kilobytes 891 Bytes\", short: \"2 Exabytes\", units: (bite: 891, kilo: 136, mega: 371, giga: 686, tera: 162, peta: 82, exa: 2, zetta: 0))\n\u003e\u003e\u003e echo bytes2human(1027) # 1 Kilobytes.\n(human: \"1 Kilobytes 3 Bytes\", short: \"1 Kilobytes\", units: (bite: 3, kilo: 1, mega: 0, giga: 0, tera: 0, peta: 0, exa: 0, zetta: 0))\n\u003e\u003e\u003e echo bytes2human(0)  # 0 Byte.\n(human: \"0 Bytes\", short: \"0 Bytes\", units: (bite: 0, kilo: 0, mega: 0, giga: 0, tera: 0, peta: 0, exa: 0, zetta: 0))\n\u003e\u003e\u003e echo bytes2human(-666)  # Invalid!.\nError: unhandled exception: 0 \u003c= integer_bytes Invalid Negative value for integer_bytes!. [AssertionError]\n\u003e\u003e\u003e\n```\n\n\n# Install\n\n```\nnimble install bytes2human\n```\n\n\n# Requisites\n\n- [Nim](https://nim-lang.org)\n\n\n# Documentation\n\n`bytes2human()`\n\n**Description:**\nCalculate Bytes, with precision from Bytes to Yottabytes.\nCalculate all Byte units from integer_bytes positive integer.\nThe proc only accepts `int64`.\n\n**Arguments:**\n- `integer_bytes` Bytes size, positive `int64` type, required.\n\n**Returns:** `HumanBytes` type, a tuple.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuancarlospaco%2Fnim-bytes2human","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuancarlospaco%2Fnim-bytes2human","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuancarlospaco%2Fnim-bytes2human/lists"}