{"id":15391408,"url":"https://github.com/mizdra/js-tinymt","last_synced_at":"2025-08-19T10:07:37.237Z","repository":{"id":102013239,"uuid":"125800601","full_name":"mizdra/js-tinymt","owner":"mizdra","description":"The JavaScript implements of TinyMT for Pokémon RNG.","archived":false,"fork":false,"pushed_at":"2018-03-20T07:11:31.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-17T17:49:37.674Z","etag":null,"topics":["javascript","pokemon","tinymt","typescript"],"latest_commit_sha":null,"homepage":null,"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/mizdra.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},"funding":{"github":"mizdra"}},"created_at":"2018-03-19T04:17:16.000Z","updated_at":"2024-02-10T15:13:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"8fbbcaee-ec49-4e34-9842-4e3bce341a9d","html_url":"https://github.com/mizdra/js-tinymt","commit_stats":{"total_commits":27,"total_committers":1,"mean_commits":27.0,"dds":0.0,"last_synced_commit":"6293a1279b77064466c7ae282794c5b143bc64a3"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mizdra/js-tinymt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizdra%2Fjs-tinymt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizdra%2Fjs-tinymt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizdra%2Fjs-tinymt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizdra%2Fjs-tinymt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mizdra","download_url":"https://codeload.github.com/mizdra/js-tinymt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizdra%2Fjs-tinymt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271134808,"owners_count":24705100,"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-19T02:00:09.176Z","response_time":63,"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":["javascript","pokemon","tinymt","typescript"],"created_at":"2024-10-01T15:11:01.674Z","updated_at":"2025-08-19T10:07:37.196Z","avatar_url":"https://github.com/mizdra.png","language":"TypeScript","funding_links":["https://github.com/sponsors/mizdra"],"categories":[],"sub_categories":[],"readme":"# js-tinymt\n\n[![Build Status](https://travis-ci.org/mizdra/js-tinymt.svg?branch=master)](https://travis-ci.org/mizdra/js-tinymt)\n[![npm version](https://badge.fury.io/js/%40mizdra%2Ftinymt.svg)](https://badge.fury.io/js/%40mizdra%2Ftinymt)\n\nThe JavaScript implements of TinyMT for Pokémon RNG.\n\n\n## :warning: Note :warning:\nThis library is not designed for common use, but for **Pokémon RNG**.\nIf you want to use for simulation and numerical analysis and so on,\n**I recommend other library**.\n\n\n## Installation\n\n```bash\n$ npm install @mizdra/tinymt -S\n# or\n$ yarn add @mizdra/tinymt\n```\n\n\n## Usage\n```js\nimport * as assert from 'assert'\nimport { Tinymt32 } from '@mizdra/tinymt'\n\nfunction u32 (num) {\n  return num \u003e\u003e\u003e 0\n}\nconst param: Tinymt32.Param = {\n  mat1: 0x8F7011EE,\n  mat2: 0xFC78FF1F,\n  tmat: 0x3793fdff,\n}\nconst seed = 1\nconst status = [0xCCA24D8, 0x11BA5AD5, 0xF2DAD045, 0xD95DD7B2]\n\n// Tinymt32.fromSeed(param, seed)\nconst rng1 = Tinymt32.fromSeed(param, seed)\nassert(u32(rng1.gen()) === 2545341989)\nassert(u32(rng1.gen()) === 981918433)\nassert.deepEqual(\n  [...Array(2)].map((_) =\u003e u32(rng1.gen())),\n  [3715302833, 2387538352],\n)\n\n// Tinymt32.fromStatus(param, status)\nconst rng2 = Tinymt32.fromStatus(param, status)\nrng2.nextState()\nassert(u32(rng2.temper()) === 2545341989)\nassert(u32(rng2.gen()) === 981918433)\nassert(u32(rng2.temper()) === 981918433)\nfor (let i = 0; i \u003c 2; i++) { rng2.nextState() }\nassert.deepEqual(\n  rng1.status().map(u32),\n  rng2.status().map(u32),\n)\n```\n\n\n## Suppoerted Feature of MersenneTwister-Lab/TinyMT\n- [x] tinymt32\n  - [x] tinymt32_next_state\n  - [x] tinymt32_temper\n  - [x] tinymt32_generate_uint32\n  - [ ] tinymt32_generate_float\n  - [ ] tinymt32_generate_float01\n  - [ ] tinymt32_generate_float12\n  - [ ] tinymt32_generate_floatOC\n  - [ ] tinymt32_generate_floatOO\n  - [ ] tinymt32_generate_32double\n- [ ] tinymt64\n  - [ ] tinymt64_next_state\n  - [ ] tinymt64_temper\n  - [ ] tinymt64_generate_uint64\n  - [ ] tinymt64_generate_double\n  - [ ] tinymt64_generate_double01\n  - [ ] tinymt64_generate_double12\n  - [ ] tinymt64_generate_doubleOC\n  - [ ] tinymt64_generate_doubleOO\n\n## License\n- js-tinymt: [LICENSE](https://raw.githubusercontent.com/mizdra/js-tinymt/master/LICENSE)\n  - Special Thanks: @odanado (ref: [RNGeek/SMBQT](https://github.com/RNGeek/SMBQT))\n- [MersenneTwister-Lab/TinyMT](https://github.com/MersenneTwister-Lab/TinyMT): [LICENSE_TINYMT](https://raw.githubusercontent.com/mizdra/js-tinymt/master/LICENSE_TINYMT) (Original: [LICENSE.txt](https://raw.githubusercontent.com/MersenneTwister-Lab/TinyMT/master/LICENSE.txt))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmizdra%2Fjs-tinymt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmizdra%2Fjs-tinymt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmizdra%2Fjs-tinymt/lists"}