martinhelmut / number-generator Goto Github PK
View Code? Open in Web Editor NEWGenerate repeatable pseudo random numbers and non-cryptographic hash numbers for usage in Node.js and browser environments.
License: MIT License
Generate repeatable pseudo random numbers and non-cryptographic hash numbers for usage in Node.js and browser environments.
License: MIT License
To verify random number results.
This issue provides visibility into Renovate updates and their statuses. Learn more
This repository currently has no open or pending branches.
Mocha and Chai could be replaced with Jest to reduce tooling.
We are having an issue installing using NPM:
Debug log:
70 verbose stack Error: [email protected] preinstall: `node ./scripts/ensure-package-manager.js`
70 verbose stack Exit status 1
70 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
70 verbose stack at EventEmitter.emit (events.js:198:13)
70 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
70 verbose stack at ChildProcess.emit (events.js:198:13)
70 verbose stack at maybeClose (internal/child_process.js:982:16)
70 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
71 verbose pkgid [email protected]
73 verbose Darwin 18.0.0
74 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "number-generator" "--save"
75 verbose node v10.16.2
76 verbose npm v6.9.0
77 error code ELIFECYCLE
78 error errno 1
79 error [email protected] preinstall: `node ./scripts/ensure-package-manager.js`
79 error Exit status 1
80 error Failed at the [email protected] preinstall script.
80 error This is probably not a problem with npm. There is likely additional logging output above.
81 verbose exit [ 1, true ]
Maybe there could be a need for the functions with BigInt support. This should be checked.
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Location: package.json
Error type: The renovate configuration file contains some invalid settings
Message: Configuration option 'packageRules[0].node' should be a json object, Invalid configuration option: author, Invalid configuration option: babel, Invalid configuration option: browserslist, Invalid configuration option: bugs, Invalid configuration option: config, Invalid configuration option: eslintConfig, Invalid configuration option: files, Invalid configuration option: homepage, Invalid configuration option: keywords, Invalid configuration option: license, Invalid configuration option: main, Invalid configuration option: module, Invalid configuration option: name, Invalid configuration option: nyc, Invalid configuration option: packageRules[1].@babel/core, Invalid configuration option: packageRules[1].@babel/preset-env, Invalid configuration option: packageRules[1].@babel/register, Invalid configuration option: packageRules[1].@rollup/plugin-babel, Invalid configuration option: packageRules[1].@rollup/plugin-node-resolve, Invalid configuration option: packageRules[1].@rollup/plugin-replace, Invalid configuration option: packageRules[1].@types/chai, Invalid configuration option: packageRules[1].@types/mocha, Invalid configuration option: packageRules[1].@types/node, Invalid configuration option: packageRules[1].agadoo, Invalid configuration option: packageRules[1].benchmark, Invalid configuration option: packageRules[1].chai, Invalid configuration option: packageRules[1].commitizen, Invalid configuration option: packageRules[1].conventional-changelog, Invalid configuration option: packageRules[1].conventional-changelog-conventionalcommits, Invalid configuration option: packageRules[1].coveralls, Invalid configuration option: packageRules[1].cz-conventional-changelog, Invalid configuration option: packageRules[1].eslint, Invalid configuration option: packageRules[1].eslint-config-prettier, Invalid configuration option: packageRules[1].jsdoc, Invalid configuration option: packageRules[1].mocha, Invalid configuration option: packageRules[1].nyc, Invalid configuration option: packageRules[1].prettier, Invalid configuration option: packageRules[1].rollup, Invalid configuration option: packageRules[1].rollup-plugin-clear, Invalid configuration option: packageRules[1].rollup-plugin-copy, Invalid configuration option: packageRules[1].rollup-plugin-external-globals, Invalid configuration option: packageRules[1].rollup-plugin-filesize, Invalid configuration option: packageRules[1].rollup-plugin-node-builtins, Invalid configuration option: packageRules[1].rollup-plugin-terser, Invalid configuration option: packageRules[1].serve, Invalid configuration option: packageRules[1].standard-version, Invalid configuration option: packageRules[1].ts-node, Invalid configuration option: packageRules[1].typescript, Invalid configuration option: renovate, Invalid configuration option: scripts, Invalid configuration option: types, Invalid configuration option: version, The "node" object can only be configured at the top level of a config but was found inside "packageRules[0]"
There are (I think configuration) problems for running browser tests with karma. The error log is:
$ karma start karma.config.js
07 03 2017 13:29:14.129:INFO [compiler.karma-typescript]: Compiling project using Typescript 2.2.1
07 03 2017 13:29:16.256:INFO [compiler.karma-typescript]: Compiled 4 files in 1572 ms.
07 03 2017 13:29:17.244:INFO [karma]: Karma v1.5.0 server started at http://0.0.0.0:9876/
07 03 2017 13:29:17.245:INFO [launcher]: Launching browsers Chrome, Firefox, Safari with unlimited concurrency
07 03 2017 13:29:17.252:INFO [launcher]: Starting browser Chrome
07 03 2017 13:29:17.260:INFO [launcher]: Starting browser Firefox
07 03 2017 13:29:17.265:INFO [launcher]: Starting browser Safari
07 03 2017 13:29:19.751:INFO [Safari 10.0.3 (Mac OS X 10.12.3)]: Connected on socket rR9nkSPrzIFUHyHcAAAA with id 79884730
Safari 10.0.3 (Mac OS X 10.12.3) ERROR
ReferenceError: Can't find variable: exports
at src/__tests__/alea-test.js:2:0 <- src/__tests__/alea-test.js:10
Safari 10.0.3 (Mac OS X 10.12.3) ERROR
ReferenceError: Can't find variable: exports
at src/__tests__/murmurhash-test.js:2:0 <- src/__tests__/murmurhash-test.js:10
Safari 10.0.3 (Mac OS X 10.12.3) ERROR
ReferenceError: Can't find variable: exports
at src/index.js:2:0 <- src/index.js:10
07 03 2017 13:29:20.862:INFO [Chrome 56.0.2924 (Mac OS X 10.12.3)]: Connected on socket bBIA3eFNiuiAzkIaAAAB with id 39048686
Chrome 56.0.2924 (Mac OS X 10.12.3) ERROR
Uncaught ReferenceError: exports is not defined
at src/__tests__/alea-test.js:2:0 <- src/__tests__/alea-test.js:10
Chrome 56.0.2924 (Mac OS X 10.12.3) ERROR
Uncaught ReferenceError: exports is not defined
at src/__tests__/murmurhash-test.js:2:0 <- src/__tests__/murmurhash-test.js:10
Chrome 56.0.2924 (Mac OS X 10.12.3) ERROR
Uncaught ReferenceError: exports is not defined
at src/index.js:2:0 <- src/index.js:10
07 03 2017 13:29:22.242:INFO [Firefox 51.0.0 (Mac OS X 10.12.0)]: Connected on socket mJ6RtOuQ2RdAiBDmAAAC with id 94746339
Firefox 51.0.0 (Mac OS X 10.12.0) ERROR
ReferenceError: exports is not defined
at src/__tests__/alea-test.js:2:0 <- src/__tests__/alea-test.js:10
error Command failed with exit code 1.
So, there could be now a missing step in the "karma-typescript" package for the commonjs result.
To verify random number generation results.
const murmurhash2_x86_32 = require('number-generator/lib/murmurhash2_x86_32');
murmurhash2_x86_32("A"); // returns 636687721
murmurhash2_x86_32("AA"); // returns 3621601297
murmurhash2_x86_32("AA"); // returns 3621601297
murmurhash2_x86_32("AAA"); // returns 2474210034
murmurhash2_x86_32("AAAA"); // returns 0
murmurhash2_x86_32("AAAAA"); // returns 2462844500
murmurhash2_x86_32("AAAAAA"); // returns 263112632
murmurhash2_x86_32("AAAAAAA"); // returns 433066591
murmurhash2_x86_32("AAAAAAAA"); // return 0
Maybe because of
Currently there are tests missing for the murmurhash2_x86_32
and the C++ reference with non ASCII characters.
To ensure proper results, before release the bundle sizes should be added to the readme file per script.
The script "node ./scripts/ensure-package-manager.js",
needs to be executed on local install for development. This cannot be done via prepare
nor preinstall
. The first will hinder a publish, the second the actual install of the package.
What: Add API documentation.
How: Generate from DocBlock comments the public API, also return objects.
Target: Transparent work for non TypeScript users.
To ensure that neither compression nor other build steps corrupt the bundle or the single created functions, there should be a npm script to run tests against that generated files.
These tests should automatically run before release.
This would also again reduce necessary tooling for this small project.
But: still provide a .d.ts
file for all TypeScript users/projects.
Seems like "chalk" is not anymore used, therefore could be removed from the list of dependencies. Maybe also check other dependencies if they are still used.
What: Add a table vor the browser support matrix.
How: Test the target browsers on devices or with a tool.
Target: Show a browser support table in the readme file, so it is visible affect in git and npm
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.