{"id":18112310,"url":"https://github.com/draeder/random-walk","last_synced_at":"2025-04-14T03:44:00.631Z","repository":{"id":48275779,"uuid":"305000357","full_name":"draeder/random-walk","owner":"draeder","description":"Generate random walk data for graphing","archived":false,"fork":false,"pushed_at":"2022-11-18T23:43:42.000Z","size":2184,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T17:47:08.458Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/draeder.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-10-18T01:28:59.000Z","updated_at":"2022-11-19T14:49:49.000Z","dependencies_parsed_at":"2022-09-03T16:41:07.170Z","dependency_job_id":null,"html_url":"https://github.com/draeder/random-walk","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/draeder%2Frandom-walk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/draeder%2Frandom-walk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/draeder%2Frandom-walk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/draeder%2Frandom-walk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/draeder","download_url":"https://codeload.github.com/draeder/random-walk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248573512,"owners_count":21126849,"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":[],"created_at":"2024-11-01T01:09:59.818Z","updated_at":"2025-04-14T03:44:00.607Z","avatar_url":"https://github.com/draeder.png","language":"JavaScript","readme":"# random-walk\nGenerate a stream of normalized random numbers using a Box Müller transform to create a true random walk.\n\nThe source of true random numbers is derived from measurements of quantum fluctions in a vacuum, provided by [the ANU Quantum Number generator](https://qrng.anu.edu.au). They come in as Uint16 (1024 every 1 second), which are then paired as Uint32 and converted to floating point numbes for use in the Box Müller transform to create a normalized random walk.\n\nIf you prefer fake random numbers as the foundation, you may also use pseudo-random numbers by adjusting the `params` object.\n\nPlease report any issues, questions or comments [here](https://github.com/draeder/random-walk/issues)\n\n## Example\n### True random source numbers\n![alt text](https://draeder.github.io/random-walk/src/random-walk-qrng.png \"Random walk true\")\n### Pseudo random source numbers\n![alt text](https://draeder.github.io/random-walk/src/random-walk-pseudo.png \"Random walk pseudo\")\n\n## Install\n`npm i random-walk`\n\n## Usage\n```\nconst Walk = require('random-walk')\nconst walk = new Walk\n```\n\n#### Example\n```\nconst Walk = require('random-walk')\nconst walk = new Walk\n\nlet params = {\n    pseudo: false,\n    rate: {min:50, max:100},\n    type: \"normal\",\n    base: 100,\n    scale: 100\n}\n\nwalk.on(\"result\", result =\u003e {\n    console.log(result)\n})\n\nwalk.get(\"walk\", params)\n```\n##### Params\nThe `params` object is an optional object that can be passed in to change the numbers returned and how quickly they are returned. \n\n###### Example\n```\nlet params = {\n    pseudo: false,   // Boolean: false = real random numbers (default), or true = psuedo random numbers\n    rate: {min:50, max:100},      // Desired rate in milliseconds: 100 (default) or {min: 50, max: 100} to randomly vary the rate\n    type: \"normal\", // \"normal\" (default), \"positive\", \"negative\"\n    base: 100,      // 0 (default). Starting value. Can be any number.\n    scale: 100      // 100 is normal (default), \u003e 100 is less volatile, \u003c 100 is more volatile\n}\n```\n\nIf `params` is not passed, defaults will be used.\n\n\nPseudo is boolean and can be `false` for real random numbers (default), or `true` for pseudo random numbers\n```\npseudo: false // true\n``` \n\nRate can be any number (default `100`), or an object `{min: 50, max: 100}` to specify min and max which will randomly vary the rate.\n```\nrate: 100 // any number\n```\nType changes how random-walk returns the numbers. Either `\"positive\"` for negative numbers only, `\"negative\"` positive numbers only, or `\"normal\"` both positive and negative numbers (default)\n```\ntype: \"normal\" // \"positive\", \"negative\"\n``` \nBase is the base number (default `0`), which might also be consered a \"mean\" or \"average\" you would like to simulate. You may use any number.\n```\nbase: 100 // any number, default is 0\n```\nScale describes the fraction applied to the random-walk result. `100` means the result will be applied as a percentage. If you would like to increase the \"volatility\" of the result, decrease the number below 100. If you would like to decrease the \"volatility\" of the result, increase the number above 100.\n```\nscale: 100 // any number, default is 100\n```\n\n### TODO\n\n- Add browser support","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdraeder%2Frandom-walk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdraeder%2Frandom-walk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdraeder%2Frandom-walk/lists"}