{"id":20637614,"url":"https://github.com/go-compile/tinytime","last_synced_at":"2025-08-10T21:03:34.682Z","repository":{"id":139680598,"uuid":"584499198","full_name":"go-compile/tinytime","owner":"go-compile","description":"Tiny timestamps which can save 4x space compared to unix timestamps, without decreasing longevity. ","archived":false,"fork":false,"pushed_at":"2023-01-02T18:39:23.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-22T00:33:57.407Z","etag":null,"topics":["bytes","hours","jwt","seconds","small","stamp","time","timestamp","tiny","unix"],"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/go-compile.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":"2023-01-02T18:35:21.000Z","updated_at":"2023-01-02T18:37:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"603b8ee2-d9fb-498b-86d0-0886276364c8","html_url":"https://github.com/go-compile/tinytime","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/go-compile/tinytime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-compile%2Ftinytime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-compile%2Ftinytime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-compile%2Ftinytime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-compile%2Ftinytime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-compile","download_url":"https://codeload.github.com/go-compile/tinytime/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-compile%2Ftinytime/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269787312,"owners_count":24475714,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"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":["bytes","hours","jwt","seconds","small","stamp","time","timestamp","tiny","unix"],"created_at":"2024-11-16T15:15:16.915Z","updated_at":"2025-08-10T21:03:34.657Z","avatar_url":"https://github.com/go-compile.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TinyTime\n\n_`Tiny Timestamps That Last Forever.`_\n\nTinyTime lets you choose how precise you want your timestamp to be, enabling shorter TinyTime stamps to be used when length/size is a concern. With TinyTime you can use a 32bit integer timestamp saving 50% of length compared to standard Unix timestamp. This can be achieved through storing **minutes rather than seconds**, or hours instead of minutes, days instead of hours etc. Even though the timestamps are smaller they will still last for thousands of years, something a Unix timestamp will not in a 32bit integer. \n\n## The Problem This Solves\n\nCommunicating a unix timestamp in readable ASCII requires **16 bytes** (in HEX), something which can make stateless tokens, urls or other usages too large, bloating and wasting characters. With TinyTime that same time stamp can be reduced to only **4 bytes** by storing the hour. In most cases down to the second precision is unnecessary. For example, a user token expiration; we only need to know at `X` hour it expires, the exact second is unimportant.\n\nWhen storing TinyTime as bytes the smallest timestamp can be `2 bytes` or `3 bytes` if stored as base64.\n\n## Install Now\n*Theres no TinyTime like the present.*\n\n```sh\ngo get github.com/go-compile/tinytime\n```\n\n## Example\nMore examples can be found in [the examples folder](./examples/).\n\n```go\npackage main\n\nimport (\n\t\"encoding/hex\"\n\t\"fmt\"\n\n\t\"github.com/go-compile/tinytime\"\n)\n\nfunc main() {\n\td := tinytime.Now().Days()\n\n\t// store in as small format as possible as HEX\n\tfmt.Println(\"Smallest Possible:\", tinytime.ToBytes(d))\n\tfmt.Println(\"Smallest Possible (Hex):\", hex.EncodeToString(tinytime.ToBytes(d)))\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-compile%2Ftinytime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-compile%2Ftinytime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-compile%2Ftinytime/lists"}