{"id":19151711,"url":"https://github.com/zhs007/libfortunajs","last_synced_at":"2026-06-14T14:30:19.310Z","repository":{"id":94328652,"uuid":"107664057","full_name":"zhs007/libfortunajs","owner":"zhs007","description":"libfortuna for nodejs","archived":false,"fork":false,"pushed_at":"2020-03-18T05:35:50.000Z","size":79,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T16:36:31.306Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhs007.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}},"created_at":"2017-10-20T10:17:18.000Z","updated_at":"2018-10-23T13:30:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"b3e41042-75d1-4632-8412-170286737091","html_url":"https://github.com/zhs007/libfortunajs","commit_stats":{"total_commits":20,"total_committers":1,"mean_commits":20.0,"dds":0.0,"last_synced_commit":"960fb6b6eb3b6169eb7299bbce93c8f892fea6c2"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhs007%2Flibfortunajs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhs007%2Flibfortunajs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhs007%2Flibfortunajs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhs007%2Flibfortunajs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhs007","download_url":"https://codeload.github.com/zhs007/libfortunajs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240236361,"owners_count":19769580,"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-09T08:15:30.710Z","updated_at":"2026-06-14T14:30:17.215Z","avatar_url":"https://github.com/zhs007.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fortuna Random Algorithm For Node.js\n\nlibfortunajs has been certified by iTech's random algorithm.\n\n### About libfortuna\n\nlibfortuna uses code from the [PostgreSQL](http://www.postgres.org/) database project.\n\nThe original source location (in the postgres source tree) is contrib/pgcrypto. Also, parts of src/include/postgres.h and src/include/c.h.\n\n### About libfortunajs\n\n[libfortunajs](https://github.com/zhs007/libfortunajs) is a nodejs c++ addon project. \n\nThis library can be compiled with [node-gyp](https://github.com/nodejs/node-gyp) .\n\n[libfortunajs](https://github.com/zhs007/libfortunajs) export some functions, which in our game only use ```randomInt``` .\n\n### Install or Compile libfortunajs\n\n[libfortunajs](https://github.com/zhs007/libfortunajs) has been publish to [npm](https://www.npmjs.com/) , all projects base nodejs can be download source code to compile and use.\n\n```\nnpm i libfortuna --save\n``` \n\nNodejs version 8.x is recommended.\n\n[libfortunajs](https://github.com/zhs007/libfortunajs) compile with [node-gyp](https://github.com/nodejs/node-gyp) .\n\nexcept nodejs, you need to python 2.x, gcc 4.9 (on linux), and on mac osx also need xcode, on windows recommended to [node-gyp](https://github.com/nodejs/node-gyp) installation instructions.\n\n### Samples\n\n``` js\nconst libfortuna = require('libfortuna');\n\nfunction randomInt(max) {\n    return libfortuna.randomInt(max);\n}\n\nexports.randomInt = randomInt;\n```\n\nWhen the actual game wheel is random, we call it this way\n\n``` js\nfor (let ii = 0; ii \u003c this.axisnums; ++ii) {\n    lstLastSymbol[ii] = base.randomInt(lstSymbol[ii].length);\n}\n```\n\n### Update log\n\n- 1.2.15 \n  - fix scaling of rng bug\n- 1.2.13 \n  - fix scaling of rng bug\n- 1.2.12 \n  - fix scaling of rng bug\n- 1.2 \n  - add randomBuf\n- 1.1 \n  - add addEntropy\n- 1.0 \n  - add random/randomInt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhs007%2Flibfortunajs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhs007%2Flibfortunajs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhs007%2Flibfortunajs/lists"}