In the browser
$ npm install @delight-im/prng
andvar Prng = ;
Creating a new instancevar prng = ;
Seeding the instance for reproducible results (optional)var seed = 42;var prng = seed;
Getting a random floating-point number between 0 (inclusive) and 1 (exclusive)var randomNumber = prng;
Retrieving a random floating-point number between a specified lower (inclusive) and upper (exclusive) boundvar randomFloat = prng;
Generating a random integer between a specified lower (inclusive) and upper (inclusive) boundvar randomInt = prng;
$ npm install -g uglify-js $ npm install -g browserify
Building the browser bundle
$ browserify src/Prng.js --standalone Prng > dist/browser-bundle.js $ uglifyjs dist/browser-bundle.js --compress --preamble "$(< src/header.js)" > dist/browser-bundle.min.js $ rm dist/browser-bundle.js
All contributions are welcome! If you wish to contribute, please create an issue first so that your feature, problem or question can be discussed.
Copyright (c) delight.im <email@example.com> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.