{"id":16627110,"url":"https://github.com/ttulka/as-uuid","last_synced_at":"2025-08-23T18:09:47.630Z","repository":{"id":48356551,"uuid":"388697866","full_name":"ttulka/as-uuid","owner":"ttulka","description":"AssemblyScript library to generate RFC-compliant UUIDs v4 (random).","archived":false,"fork":false,"pushed_at":"2022-11-02T13:22:47.000Z","size":67,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-09-13T20:15:46.869Z","etag":null,"topics":["assemblyscript","uuid","uuid4","uuidv4"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/ttulka.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}},"created_at":"2021-07-23T06:20:19.000Z","updated_at":"2024-06-06T19:10:58.000Z","dependencies_parsed_at":"2023-01-20T23:03:47.152Z","dependency_job_id":null,"html_url":"https://github.com/ttulka/as-uuid","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttulka%2Fas-uuid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttulka%2Fas-uuid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttulka%2Fas-uuid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttulka%2Fas-uuid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ttulka","download_url":"https://codeload.github.com/ttulka/as-uuid/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219856958,"owners_count":16556074,"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":["assemblyscript","uuid","uuid4","uuidv4"],"created_at":"2024-10-12T04:13:25.559Z","updated_at":"2024-10-12T04:13:26.101Z","avatar_url":"https://github.com/ttulka.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# as-uuid\n\n[AssemblyScript](https://github.com/AssemblyScript/assemblyscript) library to generate RFC-compliant UUIDs v4 (random) 🚀 \n\n## Install\n\n```sh\nnpm install as-uuid\n```\n\n## Use\n\nGenerate a random UUID string:\n\n```typescript\nimport uuid from \"as-uuid\";\n\nconst id: string = uuid();  \n\nid; // \"0f5abcd1-c194-47f3-905b-2df7263a084b\"\n```\n\n### Using NativeMath\n\nThe library use `Math.random` by default to generate random numbers. \n\nThis requires a seed for the random number generator to be imported from the host:\n\n```js\nWebAssembly.instantiateStreaming(fetch('my.wasm'), {\n  env: {\n    seed: Date.now,\n    // ...\n  }\n});\n```\n\nNotice that the seed is provided automatically when the [loader](https://www.assemblyscript.org/loader.html) is used or when WASI is imported.\n\nMore details at https://www.assemblyscript.org/stdlib/math.html#using-nativemath\n\n### Using WASI\n\nAlternatively, [WASI](https://wasi.dev) can be used to import the random number generator:\n\n```typescript\nimport uuid from \"as-uuid/uuid-wasi\";\n\nconst id: string = uuid();  \n\nid; // \"0f5abcd1-c194-47f3-905b-2df7263a084b\"\n```\n\n```js\nWebAssembly.instantiateStreaming(fetch('my.wasm'), {\n  wasi_snapshot_preview1: // ...\n});\n```\n\n## Build\n\nThe `assembly` directory contains AS source code.\n\n```sh\nnpm i\nnpm run asbuild\n```\n\n## Test\n\nThe `assembly/__tests__` directory contains all unit tests.\n\n```sh\nnpm test\nnpm run test:wasi\n```\n\n## Licence\n\n[MIT](https://github.com/ttulka/as-uuid/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttulka%2Fas-uuid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fttulka%2Fas-uuid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttulka%2Fas-uuid/lists"}