{"id":42914171,"url":"https://github.com/mixcode/golib-mtrand","last_synced_at":"2026-01-30T17:03:32.615Z","repository":{"id":144406505,"uuid":"371860315","full_name":"mixcode/golib-mtrand","owner":"mixcode","description":"A Mersenne Twister Random Number Generator","archived":false,"fork":false,"pushed_at":"2022-10-18T08:57:30.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-21T11:48:04.465Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/mixcode.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-29T02:11:37.000Z","updated_at":"2022-09-01T10:04:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"e946fff4-4b54-402a-8692-3b12a6db8aaa","html_url":"https://github.com/mixcode/golib-mtrand","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/mixcode/golib-mtrand","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mixcode%2Fgolib-mtrand","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mixcode%2Fgolib-mtrand/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mixcode%2Fgolib-mtrand/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mixcode%2Fgolib-mtrand/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mixcode","download_url":"https://codeload.github.com/mixcode/golib-mtrand/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mixcode%2Fgolib-mtrand/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28915942,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T16:37:38.804Z","status":"ssl_error","status_checked_at":"2026-01-30T16:37:37.878Z","response_time":66,"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":[],"created_at":"2026-01-30T17:03:26.684Z","updated_at":"2026-01-30T17:03:32.607Z","avatar_url":"https://github.com/mixcode.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# mtrand: A Mersenne-Twister Random Number Generator\n\nThis Go package contains Mersenne-Twister Random Number Generators of 32-bit and 64-bit.\n\nこのGoパッケージは32ビット・64ビット版のMersenne-Twister乱数生成器です。\n\n## What is this for?\n\nThis package is a translation of original Mersenne-Twister RNGs by Makoto Matsumoto and Takuji Nishimura.\nThe purpose of this package is to generate exactlay same random number sequences with original RNG implementaion.\n\nこのパッケージは広島大の松本先生・西村先生のCバージョンのMersenne Twisterコードを移植したものです。\nC関数と同じ乱数列を生成することを目的とします。\n\n## Usage\nThe package includes two RNG, MT32 and MT64. MT32 is a 32-bit implementaion and MT64 is a 64-bit implementation.\n\nMT32とMT64があります。それぞれ32ビット版・64ビット版です。\n\n#### Example\n```\n// prepare a 64-bit Mersenne Twister random number generator\nmt64 := mtrand.NewMT64()\n\n// init with a seed\nmt64.Init(1234567)\n\n// make some numbers\nfmt.Printf(\"%v\\n\", mt64.GenUint64()) // [0, 2^64-1]\nfmt.Printf(\"%v\\n\", mt64.GenInt63())  // [0, 2^63-1]\nfmt.Printf(\"%v\\n\", mt64.GenReal2())  // [0,1)\n\n// Output:\n// 18172760479972437302\n// 7074784410711093237\n// 0.656181023402107\n```\n\n## Go interface\n\nAdditionally, both RNG has interfaces to Go's built-in math/rand and io.Reader for crypto/rand.\n\nGo標準ライブラリのmath/randやcrypto/randに食わせる用のインタフェースも用意されてます。\n\n\n#### Example of feeding a MT32 to math/rand\n```\ninclude \"math/rand\"\n// ...\n\n// use with math/rand\nrng := rand.New(mtrand.NewMT32())\nrng.Seed(1234)\nfmt.Println(rng.Intn(512))\n```\n\n\n## Copyright of original work\n\nSee [COPYRIGHT](./COPYRIGHT.md) for copyright notice of original C source codes.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmixcode%2Fgolib-mtrand","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmixcode%2Fgolib-mtrand","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmixcode%2Fgolib-mtrand/lists"}