{"id":15136243,"url":"https://github.com/jamescook/ulid_fast","last_synced_at":"2025-04-13T04:35:10.357Z","repository":{"id":59158516,"uuid":"239767600","full_name":"jamescook/ulid_fast","owner":"jamescook","description":"Fast ULID generation","archived":false,"fork":false,"pushed_at":"2020-02-11T13:41:46.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T21:22:54.372Z","etag":null,"topics":["c","ruby","ulid"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamescook.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-11T13:24:21.000Z","updated_at":"2020-02-11T18:34:06.000Z","dependencies_parsed_at":"2022-09-13T17:51:02.930Z","dependency_job_id":null,"html_url":"https://github.com/jamescook/ulid_fast","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/jamescook%2Fulid_fast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamescook%2Fulid_fast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamescook%2Fulid_fast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamescook%2Fulid_fast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamescook","download_url":"https://codeload.github.com/jamescook/ulid_fast/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248664161,"owners_count":21141907,"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":["c","ruby","ulid"],"created_at":"2024-09-26T06:04:40.587Z","updated_at":"2025-04-13T04:35:10.336Z","avatar_url":"https://github.com/jamescook.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ulid_fast - Fast ULID Generator\n\n`ulid_fast` wraps the [ulid-c](https://github.com/skeeto/ulid-c/) library to provide fast ULID generation.\n\n### Example Usage\n\n```ruby\nrequire 'ulid_fast'\n\nULID::Generator.new.generate\n=\u003e \"01E0T6ZE28TSXRQTJC9AR9P362\"\n\n```\n\nFor long-lived Ruby applications (e.g. Rails), I recommend a different pattern to improve performance:\n```ruby\nrequire 'ulid_fast'\n\n# Put this in config/initializers/ulid.rb, for example\nULID_GENERATOR = ULID::Generator.new\n\n# Wherever you need a ULID, do this:\nULID_GENERATOR.generate\n```\n\nYou don't need to create a generator instance for each ULID. When the instance is allocated, we call\n`ulid_generator_init` which bootstraps the randomness feature of each generated ULID.\n\n\n### Performance\n\nComparing to the pure-Ruby [ULID](https://github.com/rafaelsales/ulid) it's a lot faster provided\nyou are not re-initializing the generator for every ULID (see usage notes above).\n\n```\nComparison:\nULID::Generator#generate:  2650174.9 i/s\n           ULID.generate:    41236.1 i/s - 64.27x  slower\n```\n\n### Todo \n- Integrate `Enumerator` so we can generate batches of ULIDs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamescook%2Fulid_fast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamescook%2Fulid_fast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamescook%2Fulid_fast/lists"}