{"id":16572115,"url":"https://github.com/eddelbuettel/ulid","last_synced_at":"2026-02-27T15:02:09.792Z","repository":{"id":141238972,"uuid":"163427359","full_name":"eddelbuettel/ulid","owner":"eddelbuettel","description":"Universally Unique Lexicographically Sortable Identifiers in R","archived":false,"fork":false,"pushed_at":"2025-11-05T22:29:23.000Z","size":95,"stargazers_count":30,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-09T11:32:09.790Z","etag":null,"topics":["r","rstats","ulid","uuid"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eddelbuettel.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","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-12-28T16:03:40.000Z","updated_at":"2025-11-05T22:29:28.000Z","dependencies_parsed_at":"2024-06-11T17:04:10.765Z","dependency_job_id":"c684d83e-f710-4b60-bcbd-1c3f83457827","html_url":"https://github.com/eddelbuettel/ulid","commit_stats":{"total_commits":21,"total_committers":2,"mean_commits":10.5,"dds":0.4285714285714286,"last_synced_commit":"2adb62a8214e54771819765666f619b2164c1c13"},"previous_names":["eddelbuettel/ulid","hrbrmstr/ulid"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/eddelbuettel/ulid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddelbuettel%2Fulid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddelbuettel%2Fulid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddelbuettel%2Fulid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddelbuettel%2Fulid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eddelbuettel","download_url":"https://codeload.github.com/eddelbuettel/ulid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddelbuettel%2Fulid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29901129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T14:46:13.553Z","status":"ssl_error","status_checked_at":"2026-02-27T14:46:10.522Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["r","rstats","ulid","uuid"],"created_at":"2024-10-11T21:26:28.141Z","updated_at":"2026-02-27T15:02:09.786Z","avatar_url":"https://github.com/eddelbuettel.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n## ulid -- Universally Unique Lexicographically Sortable Identifiers\n\n[![CI](https://github.com/eddelbuettel/ulid/actions/workflows/ci.yaml/badge.svg)](https://github.com/eddelbuettel/ulid/actions/workflows/ci.yaml)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/license/mit)\n[![CRAN](https://www.r-pkg.org/badges/version/ulid)](https://cran.r-project.org/package=ulid)\n[![r-universe](https://eddelbuettel.r-universe.dev/badges/ulid)](https://eddelbuettel.r-universe.dev/ulid)\n[![Dependencies](https://tinyverse.netlify.app/badge/ulid)](https://cran.r-project.org/package=ulid)\n[![Downloads](https://cranlogs.r-pkg.org/badges/ulid?color=brightgreen)](https://www.r-pkg.org:443/pkg/ulid)\n[![Last Commit](https://img.shields.io/github/last-commit/eddelbuettel/ulid)](https://github.com/eddelbuettel/ulid)\n\n\n### Description\n\nAs described in the [ulid specification repo](https://github.com/ulid/spec),\nand slightly edited here, UUID use can be suboptimal for many uses-cases because:\n\n  - It is not the most character efficient way of encoding 128 bits of randomness\n  - UUID v1/v2 is impractical in many environments, as it requires access to a unique, stable MAC address\n  - UUID v3/v5 requires a unique seed and produces randomly distributed IDs, which can cause fragmentation in many data structures\n  - UUID v4 provides no other information than randomness which can cause fragmentation in many data structures\n\nInstead, an alternative is proposed in ULID:\n\n``` javascript\nulid() // 01ARZ3NDEKTSV4RRFFQ69G5FAV\n```\n\nwith the following properties:\n\n  - 128-bit compatibility with UUID\n  - 1.21e+24 unique ULIDs per millisecond\n  - Lexicographically sortable\\!\n  - Canonically encoded as a 26 character string, as opposed to the 36 character UUID\n  - Uses [base32 by Crockford](https://www.crockford.com/base32.html) for better efficiency and readability (5 bits per character)\n  - Case insensitive\n  - No special characters (URL safe)\n  - Monotonic sort order (correctly detects and handles the same millisecond)\n\n\n```\n 01AN4Z07BY      79KA1307SR9X4MV3\n\n|----------|    |----------------|\n Timestamp          Randomness\n   48bits             80bits\n```\n\n#### Components\n\nTimestamp\n\n- 48 bit integer\n- UNIX-time in milliseconds\n- Will not run out of space until the year 10889 AD.\n\nRandomness\n\n- 80 bits\n- Cryptographically secure source of randomness, if possible\n\n#### Sorting\n\nThe left-most character must be sorted first, and the right-most\ncharacter sorted last (lexical order). The default ASCII character set\nmust be used. Within the same millisecond, sort order is not guaranteed.\n\n### What Is Supported:\n\nThe following functions are implemented:\n\n  - `ts_generate`: Generate ULIDs from timestamps\n  - `ULIDgenerate`: Generate ULIDs\n  - `unmarshal`: Unmarshal a ULID into a data frame with timestamp and random bitstring columns\n  - `ulid`: Alias for `ULIDgenerate`\n\n### Installation\n\nThe package can be installed from [CRAN](https://cran.r-project.org) via `install.packages(\"ulid\")`.\nDevelopment versions can also be installed from this repository or from\n[r-universe](https://eddelbuettel.r-universe.dev/ulid) via\n\n```r\nr \u003c- c('https://eddelbuettel.r-universe.dev', 'https://cloud.r-project.org')\ninstall.packages('ulid', repos = r)\n```\n\n### Usage\n\n``` r\nulid::ULIDgenerate()\n## [1] \"0001EKRGEEV98QP062VNRX31P2\"\n\n(u \u003c- ulid::ULIDgenerate(20))\n##  [1] \"0001EKRGEEV5XMP54RRRWAK318\" \"0001EKRGEEKX7VC0PF75AZJXHP\"\n##  [3] \"0001EKRGEEXENNCQEH4KCH8QAD\" \"0001EKRGEEY41HJ6GMXRV1BQBA\"\n##  [5] \"0001EKRGEE6HVD7ACWZ52MTVCJ\" \"0001EKRGEEQWXMPXGC0DGQN32B\"\n##  [7] \"0001EKRGEE6W13BK92EF1RXYT7\" \"0001EKRGEE5A31H38NJFGTK8PC\"\n##  [9] \"0001EKRGEEG2GXS53QY9F3M0A9\" \"0001EKRGEEDA3Y6Y0T52WTS6RM\"\n## [11] \"0001EKRGEE5WS2S3D9KY3F5H9Y\" \"0001EKRGEE24SZW5NATAADAY9Q\"\n## [13] \"0001EKRGEEBEG51QCKXPM8ZS16\" \"0001EKRGEE1ZC1QY7RCJR9VJ0B\"\n## [15] \"0001EKRGEECJ50Z4FXM4HW6XWG\" \"0001EKRGEEER84JP8WTXV5DWV8\"\n## [17] \"0001EKRGEEW3ABA82GZSRXN1RB\" \"0001EKRGEEAA60CYFGR8832JD6\"\n## [19] \"0001EKRGEE6W5ARCFHH6T75FPZ\" \"0001EKRGEE5WT4XNP7NS69BM3X\"\n\nunmarshal(u)\n##                     ts              rnd\n## 1  2019-07-27 08:21:34 V5XMP54RRRWAK318\n## 2  2019-07-27 08:21:34 KX7VC0PF75AZJXHP\n## 3  2019-07-27 08:21:34 XENNCQEH4KCH8QAD\n## 4  2019-07-27 08:21:34 Y41HJ6GMXRV1BQBA\n## 5  2019-07-27 08:21:34 6HVD7ACWZ52MTVCJ\n## 6  2019-07-27 08:21:34 QWXMPXGC0DGQN32B\n## 7  2019-07-27 08:21:34 6W13BK92EF1RXYT7\n## 8  2019-07-27 08:21:34 5A31H38NJFGTK8PC\n## 9  2019-07-27 08:21:34 G2GXS53QY9F3M0A9\n## 10 2019-07-27 08:21:34 DA3Y6Y0T52WTS6RM\n## 11 2019-07-27 08:21:34 5WS2S3D9KY3F5H9Y\n## 12 2019-07-27 08:21:34 24SZW5NATAADAY9Q\n## 13 2019-07-27 08:21:34 BEG51QCKXPM8ZS16\n## 14 2019-07-27 08:21:34 1ZC1QY7RCJR9VJ0B\n## 15 2019-07-27 08:21:34 CJ50Z4FXM4HW6XWG\n## 16 2019-07-27 08:21:34 ER84JP8WTXV5DWV8\n## 17 2019-07-27 08:21:34 W3ABA82GZSRXN1RB\n## 18 2019-07-27 08:21:34 AA60CYFGR8832JD6\n## 19 2019-07-27 08:21:34 6W5ARCFHH6T75FPZ\n## 20 2019-07-27 08:21:34 5WT4XNP7NS69BM3X\n\n(ut \u003c- ts_generate(as.POSIXct(\"2017-11-01 15:00:00\", origin=\"1970-01-01\")))\n## [1] \"0001CZM6DG2THKSAX3F1SF30E7\"\n\nunmarshal(ut)\n##                    ts              rnd\n## 1 2017-11-01 15:00:00 2THKSAX3F1SF30E7\n```\n\n### Millisecond Resolution\n\nAs per [issue #13](https://github.com/suyash/ulid/issues/13) on the upstream repo, time is actually\nencoded mostly as `time_t` leading to second rather than millisecond resolution. Two patches by\nChris Brove also collected in [his fork](https://github.com/ChrisBove/ulid) improve on this by using\n`std::chrono` objects internally.  In release 0.4.0, we have switched to his fork and extended the\nwrapper functions to support this:\n\n```r\n\u003e library(ulid)\n\u003e gen_ulid \u003c- \\(sleep) replicate(5, {Sys.sleep(sleep); generate()})\n\u003e u \u003c- gen_ulid(.1)\n\u003e df \u003c- unmarshal(u)\n\u003e data.table::data.table(df)\n                        ts              rnd\n                    \u003cPOSc\u003e           \u003cchar\u003e\n1: 2024-05-30 16:38:28.588 CSQAJBPNX75R0G5A\n2: 2024-05-30 16:38:28.688 XZX0TREDHD6PC1YR\n3: 2024-05-30 16:38:28.789 0YK9GKZVTED27QMK\n4: 2024-05-30 16:38:28.890 SC3M3G6KGPH7S50S\n5: 2024-05-30 16:38:28.990 TSKCBWJ3TEKCPBY0\n\u003e\n```\n\n### Author\n\n[Suyash Verma](https://github.com/suyash) wrote the C++ header library\n[ulid](https://github.com/suyash/ulid).\n\n[Chris Bove](https://github.com/ChrisBove) updated internals to permit sub-second resolution in his\n[fork](https://github.com/ChrisBove/ulid).\n\n[Bob Rudis](https://rud.is) created the R package, prepared versions 0.1.0 and 0.2.0, and released version 0.3.0 to CRAN.\n\n[Dirk Eddelbuettel](https://dirk.eddelbuettel.com) has been the R package maintainer since release 0.3.1, and added sub-second support.\n\n### License\n\nThe package is licensed under the MIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddelbuettel%2Fulid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feddelbuettel%2Fulid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddelbuettel%2Fulid/lists"}