number-generator
Advanced tools
Comparing version
@@ -1,5 +0,87 @@ | ||
# Change Log | ||
# Changelog | ||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. | ||
## 3.0.0 (2019-06-21) | ||
### Bug Fixes | ||
* **state:** Don't use import helpers to resolve smaller compile results ([246a751](https://github.com/MartinHelmut/number-generator/commit/246a751)) | ||
* **test:** Run tests also on Windows ([24e6d3b](https://github.com/MartinHelmut/number-generator/commit/24e6d3b)) | ||
* **travis:** Simplyfied test command ([1f56366](https://github.com/MartinHelmut/number-generator/commit/1f56366)) | ||
* copy all typings to the distribution folder lib ([6fd3ead](https://github.com/MartinHelmut/number-generator/commit/6fd3ead)) | ||
* deactivate minify step ([51dd176](https://github.com/MartinHelmut/number-generator/commit/51dd176)) | ||
* ignore esloint compat option for build script ([7d98b8e](https://github.com/MartinHelmut/number-generator/commit/7d98b8e)) | ||
* murmurhash2_x86_32 do not return 0 for strings length multiply of 4 ([ceb8704](https://github.com/MartinHelmut/number-generator/commit/ceb8704)), closes [#78](https://github.com/MartinHelmut/number-generator/issues/78) | ||
* remove bundle size based on security and pipeline issues ([480ac94](https://github.com/MartinHelmut/number-generator/commit/480ac94)) | ||
* show esm usage in readme ([7f51be3](https://github.com/MartinHelmut/number-generator/commit/7f51be3)) | ||
### Build System | ||
* **lint:** Added eslint config to lint js config files (editor only) ([b95845a](https://github.com/MartinHelmut/number-generator/commit/b95845a)) | ||
* run tests against production bundles ([0d87b11](https://github.com/MartinHelmut/number-generator/commit/0d87b11)) | ||
* **release:** Committing generated artifacts in the release commit ([c2c658c](https://github.com/MartinHelmut/number-generator/commit/c2c658c)) | ||
* add browserlist option for maintained node versions ([48a24a7](https://github.com/MartinHelmut/number-generator/commit/48a24a7)) | ||
* Added prettier to format code ([1149b1d](https://github.com/MartinHelmut/number-generator/commit/1149b1d)) | ||
* clean up browser list environment and browser support ([72f3b87](https://github.com/MartinHelmut/number-generator/commit/72f3b87)) | ||
* drop support for node 6 and IE9 ([e17e5e6](https://github.com/MartinHelmut/number-generator/commit/e17e5e6)) | ||
* generate package-lock.json ([474c415](https://github.com/MartinHelmut/number-generator/commit/474c415)) | ||
* remove husky and lint-staged ([3888ea6](https://github.com/MartinHelmut/number-generator/commit/3888ea6)) | ||
* replace closure compiler js with terser ([a0ccab3](https://github.com/MartinHelmut/number-generator/commit/a0ccab3)) | ||
* replaced rollup-plugin-cpy with own version ([77e936b](https://github.com/MartinHelmut/number-generator/commit/77e936b)) | ||
* strip uglifyjs of api v2 cli flags ([e2a1ba1](https://github.com/MartinHelmut/number-generator/commit/e2a1ba1)) | ||
* use prettier as a pre-commit hook for js and md files ([203bdb8](https://github.com/MartinHelmut/number-generator/commit/203bdb8)) | ||
* **rollup:** show correct bundle and gzip size ([5a33988](https://github.com/MartinHelmut/number-generator/commit/5a33988)) | ||
* **rollup:** use clear plugin ([5be81fb](https://github.com/MartinHelmut/number-generator/commit/5be81fb)) | ||
* **rollup:** use cpy plugin to copy d.ts files to lib ([8cf052d](https://github.com/MartinHelmut/number-generator/commit/8cf052d)) | ||
* **tcs:** Use commonjs as target module type ([6c17cf0](https://github.com/MartinHelmut/number-generator/commit/6c17cf0)) | ||
* use rollup and closure to bundle single functions as well ([dc623f3](https://github.com/MartinHelmut/number-generator/commit/dc623f3)) | ||
* use rollup to build target bundle ([d165be7](https://github.com/MartinHelmut/number-generator/commit/d165be7)) | ||
### Features | ||
* **state:** Added getter and setter for internal state ([94907f9](https://github.com/MartinHelmut/number-generator/commit/94907f9)) | ||
* add tree shaking check to production build step ([64c38c9](https://github.com/MartinHelmut/number-generator/commit/64c38c9)) | ||
* Change implementation from typescript to javascript ([809ed99](https://github.com/MartinHelmut/number-generator/commit/809ed99)), closes [#7](https://github.com/MartinHelmut/number-generator/issues/7) | ||
* Initial beta release ([0fea451](https://github.com/MartinHelmut/number-generator/commit/0fea451)) | ||
* new function murmurhash3_x86_32 ([9506eab](https://github.com/MartinHelmut/number-generator/commit/9506eab)) | ||
* split methods to single functions ([e578e61](https://github.com/MartinHelmut/number-generator/commit/e578e61)) | ||
* throw a TypeError if hash is not a string for murmur functions ([0b07d34](https://github.com/MartinHelmut/number-generator/commit/0b07d34)) | ||
* use mocha and chai instead of jest ([c4a20b8](https://github.com/MartinHelmut/number-generator/commit/c4a20b8)) | ||
### refactor | ||
* rename murmurHash function ([23951a8](https://github.com/MartinHelmut/number-generator/commit/23951a8)) | ||
### Tests | ||
* **alea:** Added tests for incomplete state object ([6a137fd](https://github.com/MartinHelmut/number-generator/commit/6a137fd)) | ||
* add explicit test cases for reference implementations ([ab888de](https://github.com/MartinHelmut/number-generator/commit/ab888de)) | ||
* **karma:** Added test runner for browser tests ([52e7e45](https://github.com/MartinHelmut/number-generator/commit/52e7e45)) | ||
* add check for compatibility and function name export ([25a95f6](https://github.com/MartinHelmut/number-generator/commit/25a95f6)) | ||
* add explicit implementation test ([fa4450c](https://github.com/MartinHelmut/number-generator/commit/fa4450c)) | ||
* add TypeScript typings test ([e35138d](https://github.com/MartinHelmut/number-generator/commit/e35138d)) | ||
* add unit tests for helpful error message on murmur functions hash validation ([bb55991](https://github.com/MartinHelmut/number-generator/commit/bb55991)) | ||
* add utils tests ([4d360ec](https://github.com/MartinHelmut/number-generator/commit/4d360ec)) | ||
* Fixed karma browser test runner ([cf97d33](https://github.com/MartinHelmut/number-generator/commit/cf97d33)) | ||
* increase test loop iteration times 10 ([393ebc7](https://github.com/MartinHelmut/number-generator/commit/393ebc7)) | ||
* Renamed test cases ([0a36768](https://github.com/MartinHelmut/number-generator/commit/0a36768)) | ||
* Run build step before run tests ([b507592](https://github.com/MartinHelmut/number-generator/commit/b507592)) | ||
* scope production test run to functions that get packaged ([10c126a](https://github.com/MartinHelmut/number-generator/commit/10c126a)) | ||
* use dedicated istanbul configuration file ([4763827](https://github.com/MartinHelmut/number-generator/commit/4763827)) | ||
* Use jest as test runner ([2c055ad](https://github.com/MartinHelmut/number-generator/commit/2c055ad)), closes [#6](https://github.com/MartinHelmut/number-generator/issues/6) | ||
### BREAKING CHANGES | ||
* murmurHash function is now murmurhash2_x86_32 | ||
* This changes the language the library is implemented in. | ||
<a name="2.3.1"></a> | ||
@@ -6,0 +88,0 @@ ## [2.3.1](https://github.com/MartinHelmut/number-generator/compare/v2.3.0...v2.3.1) (2019-01-19) |
@@ -1,2 +0,2 @@ | ||
import { aleaRNGFactory } from '.'; | ||
import { aleaRNGFactory } from "."; | ||
export default aleaRNGFactory; |
export declare interface NumberGeneratorState { | ||
correction: number; | ||
sequence: number[]; | ||
correction: number; | ||
sequence: number[]; | ||
} | ||
export declare interface NumberGenerator { | ||
setSeed: (seed: number) => number; | ||
uFloat32: () => number; | ||
uInt32: () => number; | ||
getState: () => NumberGeneratorState; | ||
setState: (state?: NumberGeneratorState) => void; | ||
setSeed: (seed: number) => number; | ||
uFloat32: () => number; | ||
uInt32: () => number; | ||
getState: () => NumberGeneratorState; | ||
setState: (state?: NumberGeneratorState) => void; | ||
} | ||
export declare type NumberHashGenerator = (hash: string, seed?: number) => number; | ||
export declare type NumberHashGenerator = ( | ||
hash: string, | ||
seed?: number | ||
) => number; | ||
@@ -16,0 +19,0 @@ export declare function aleaRNGFactory(initialSeed?: number): NumberGenerator; |
@@ -1,2 +0,2 @@ | ||
function e(e,t){return(65535&(e|=0))*(t|=0)+(((e>>>16)*t&65535)<<16)|0}function t(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t++)<<8)+(e.charCodeAt(t++)<<16)+(e.charCodeAt(t)<<24)}function r(e){if(void 0!==e&&e%1!=0)throw new TypeError("Expected seed to be an integer, float given")}function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("string"!=typeof e){var r=t?"".concat(t,"() "):"";throw new TypeError("".concat(r,"first argument is not a string."))}}var o=function(){var e=1,t=0,r=0,n=0,o=Math.pow(2,-32),c=Math.pow(2,32),a=2091639,u=69069;return function(i){var h=e,f=t,s=r,d=n;function v(t){return function(e){if(e%1!=0||e<=0)throw new TypeError('Expected seed to be an unsigned integer greater 1, but got "'.concat(e,'"'))}(t),f=(t>>>0)*o,s=(t=t*u+1>>>0)*o,d=(t=t*u+1>>>0)*o,h=e,t}function g(){var e=a*f+h*o;return f=s,s=d,d=e-(h=0|e)}return v(void 0===i?1:i),{setSeed:v,uFloat32:g,uInt32:function(){return g()*c>>>0},getState:function(){return{correction:h,sequence:[f,s,d]}},setState:function(o){(o=o||{correction:e,sequence:[t,r,n]}).sequence=o.sequence||[],h=o.correction||e,f=o.sequence[0]||t,s=o.sequence[1]||r,d=o.sequence[2]||n}}}}(),c=function(){var o=1540483477,c=24,a=function(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t)<<8)};return function(u){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;n(u,"murmurhash2_x86_32"),r(i);for(var h=0,f=i^u.length,s=u.length;s>=4;){var d=t(u,h);d=e(d,o),d=e(d^=d>>>c,o),f=e(f,o),f^=d,h+=4,s-=4}switch(s){case 3:f^=a(u,h),f=e(f^=u.charCodeAt(h+2)<<16,o);break;case 2:f=e(f^=a(u,h),o);break;case 1:f=e(f^=u.charCodeAt(h),o)}return f=e(f^=f>>>13,o),(f^=f>>>15)>>>0}}(),a=function(){var o=3432918353,c=461845907,a=2246822507,u=3266489909,i=3864292196,h=function(e,t){return e<<t|e>>>32-t};return function(f){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;n(f,"murmurhash3_x86_32"),r(s);for(var d=f.length%4,v=f.length-d,g=0,A=0,C=s;A<v;)g=e(g=t(f,A),o),g=e(g=h(g,15),c),C=e(C=h(C^=g,13),5)+i,A+=4;switch(g=0,d){case 3:g^=(255&f.charCodeAt(A+2))<<16;case 2:g^=(255&f.charCodeAt(A+1))<<8;case 1:g=e(g^=255&f.charCodeAt(A),o),C^=g=e(g=h(g,15),c)}return C^=f.length,C=e(C^=C>>>16,a),C=e(C^=C>>>13,u),(C^=C>>>16)>>>0}}(),u=c;export{o as aleaRNGFactory,c as murmurhash2_x86_32,u as murmurHash,a as murmurhash3_x86_32}; | ||
function e(e,t){return(65535&(e|=0))*(t|=0)+(((e>>>16)*t&65535)<<16)|0}function t(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t++)<<8)+(e.charCodeAt(t++)<<16)+(e.charCodeAt(t)<<24)}function r(e){if(void 0!==e&&e%1!=0)throw new TypeError("Expected seed to be an integer, float given")}function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("string"!=typeof e){var r=t?"".concat(t,"() "):"";throw new TypeError("".concat(r,"first argument is not a string."))}}var o=function(){var e=1,t=0,r=0,n=0,o=Math.pow(2,-32),c=Math.pow(2,32),a=2091639,u=69069;return function(i){var h=e,f=t,s=r,d=n;function v(t){return function(e){if(e%1!=0||e<=0)throw new TypeError('Expected seed to be an unsigned integer greater 1, but got "'.concat(e,'"'))}(t),f=(t>>>0)*o,s=(t=t*u+1>>>0)*o,d=(t=t*u+1>>>0)*o,h=e,t}function g(){var e=a*f+h*o;return f=s,s=d,d=e-(h=0|e)}return v(void 0===i?1:i),{setSeed:v,uFloat32:g,uInt32:function(){return g()*c>>>0},getState:function(){return{correction:h,sequence:[f,s,d]}},setState:function(o){(o=o||{correction:e,sequence:[t,r,n]}).sequence=o.sequence||[],h=o.correction||e,f=o.sequence[0]||t,s=o.sequence[1]||r,d=o.sequence[2]||n}}}}(),c=function(){var o=1540483477,c=24,a=function(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t)<<8)};return function(u){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;n(u,"murmurhash2_x86_32"),r(i);for(var h=0,f=i^u.length,s=u.length;s>=4;){var d=t(u,h);d=e(d,o),d=e(d^=d>>>c,o),f=e(f,o),f^=d,h+=4,s-=4}switch(s){case 3:f^=a(u,h),f=e(f^=u.charCodeAt(h+2)<<16,o);break;case 2:f=e(f^=a(u,h),o);break;case 1:f=e(f^=u.charCodeAt(h),o)}return f=e(f^=f>>>13,o),(f^=f>>>15)>>>0}}(),a=function(){var o=3432918353,c=461845907,a=2246822507,u=3266489909,i=3864292196,h=function(e,t){return e<<t|e>>>32-t};return function(f){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;n(f,"murmurhash3_x86_32"),r(s);for(var d=f.length%4,v=f.length-d,g=0,A=0,C=s;A<v;)g=e(g=t(f,A),o),g=e(g=h(g,15),c),C=e(C=h(C^=g,13),5)+i,A+=4;switch(g=0,d){case 3:g^=(255&f.charCodeAt(A+2))<<16;case 2:g^=(255&f.charCodeAt(A+1))<<8;case 1:g=e(g^=255&f.charCodeAt(A),o),C^=g=e(g=h(g,15),c)}return C^=f.length,C=e(C^=C>>>16,a),C=e(C^=C>>>13,u),(C^=C>>>16)>>>0}}(),u=c;export{o as aleaRNGFactory,u as murmurHash,c as murmurhash2_x86_32,a as murmurhash3_x86_32}; | ||
//# sourceMappingURL=index.esm.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).numberGenerator={})}(this,function(e){"use strict";function t(e,t){return(65535&(e|=0))*(t|=0)+(((e>>>16)*t&65535)<<16)|0}function r(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t++)<<8)+(e.charCodeAt(t++)<<16)+(e.charCodeAt(t)<<24)}function n(e){if(void 0!==e&&e%1!=0)throw new TypeError("Expected seed to be an integer, float given")}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("string"!=typeof e){var r=t?"".concat(t,"() "):"";throw new TypeError("".concat(r,"first argument is not a string."))}}var c=function(){var e=1,t=0,r=0,n=0,o=Math.pow(2,-32),c=Math.pow(2,32),u=2091639,a=69069;return function(i){var f=e,s=t,h=r,d=n;function v(t){return function(e){if(e%1!=0||e<=0)throw new TypeError('Expected seed to be an unsigned integer greater 1, but got "'.concat(e,'"'))}(t),s=(t>>>0)*o,h=(t=t*a+1>>>0)*o,d=(t=t*a+1>>>0)*o,f=e,t}function g(){var e=u*s+f*o;return s=h,h=d,d=e-(f=0|e)}return v(void 0===i?1:i),{setSeed:v,uFloat32:g,uInt32:function(){return g()*c>>>0},getState:function(){return{correction:f,sequence:[s,h,d]}},setState:function(o){(o=o||{correction:e,sequence:[t,r,n]}).sequence=o.sequence||[],f=o.correction||e,s=o.sequence[0]||t,h=o.sequence[1]||r,d=o.sequence[2]||n}}}}(),u=function(){var e=1540483477,c=24,u=function(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t)<<8)};return function(a){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o(a,"murmurhash2_x86_32"),n(i);for(var f=0,s=i^a.length,h=a.length;h>=4;){var d=r(a,f);d=t(d,e),d=t(d^=d>>>c,e),s=t(s,e),s^=d,f+=4,h-=4}switch(h){case 3:s^=u(a,f),s=t(s^=a.charCodeAt(f+2)<<16,e);break;case 2:s=t(s^=u(a,f),e);break;case 1:s=t(s^=a.charCodeAt(f),e)}return s=t(s^=s>>>13,e),(s^=s>>>15)>>>0}}(),a=function(){var e=3432918353,c=461845907,u=2246822507,a=3266489909,i=3864292196,f=function(e,t){return e<<t|e>>>32-t};return function(s){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o(s,"murmurhash3_x86_32"),n(h);for(var d=s.length%4,v=s.length-d,g=0,l=0,p=h;l<v;)g=t(g=r(s,l),e),g=t(g=f(g,15),c),p=t(p=f(p^=g,13),5)+i,l+=4;switch(g=0,d){case 3:g^=(255&s.charCodeAt(l+2))<<16;case 2:g^=(255&s.charCodeAt(l+1))<<8;case 1:g=t(g^=255&s.charCodeAt(l),e),p^=g=t(g=f(g,15),c)}return p^=s.length,p=t(p^=p>>>16,u),p=t(p^=p>>>13,a),(p^=p>>>16)>>>0}}(),i=u;e.aleaRNGFactory=c,e.murmurhash2_x86_32=u,e.murmurHash=i,e.murmurhash3_x86_32=a,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).numberGenerator={})}(this,function(e){"use strict";function t(e,t){return(65535&(e|=0))*(t|=0)+(((e>>>16)*t&65535)<<16)|0}function r(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t++)<<8)+(e.charCodeAt(t++)<<16)+(e.charCodeAt(t)<<24)}function n(e){if(void 0!==e&&e%1!=0)throw new TypeError("Expected seed to be an integer, float given")}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("string"!=typeof e){var r=t?"".concat(t,"() "):"";throw new TypeError("".concat(r,"first argument is not a string."))}}var c=function(){var e=1,t=0,r=0,n=0,o=Math.pow(2,-32),c=Math.pow(2,32),u=2091639,a=69069;return function(i){var f=e,s=t,h=r,d=n;function v(t){return function(e){if(e%1!=0||e<=0)throw new TypeError('Expected seed to be an unsigned integer greater 1, but got "'.concat(e,'"'))}(t),s=(t>>>0)*o,h=(t=t*a+1>>>0)*o,d=(t=t*a+1>>>0)*o,f=e,t}function g(){var e=u*s+f*o;return s=h,h=d,d=e-(f=0|e)}return v(void 0===i?1:i),{setSeed:v,uFloat32:g,uInt32:function(){return g()*c>>>0},getState:function(){return{correction:f,sequence:[s,h,d]}},setState:function(o){(o=o||{correction:e,sequence:[t,r,n]}).sequence=o.sequence||[],f=o.correction||e,s=o.sequence[0]||t,h=o.sequence[1]||r,d=o.sequence[2]||n}}}}(),u=function(){var e=1540483477,c=24,u=function(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t)<<8)};return function(a){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o(a,"murmurhash2_x86_32"),n(i);for(var f=0,s=i^a.length,h=a.length;h>=4;){var d=r(a,f);d=t(d,e),d=t(d^=d>>>c,e),s=t(s,e),s^=d,f+=4,h-=4}switch(h){case 3:s^=u(a,f),s=t(s^=a.charCodeAt(f+2)<<16,e);break;case 2:s=t(s^=u(a,f),e);break;case 1:s=t(s^=a.charCodeAt(f),e)}return s=t(s^=s>>>13,e),(s^=s>>>15)>>>0}}(),a=function(){var e=3432918353,c=461845907,u=2246822507,a=3266489909,i=3864292196,f=function(e,t){return e<<t|e>>>32-t};return function(s){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o(s,"murmurhash3_x86_32"),n(h);for(var d=s.length%4,v=s.length-d,g=0,l=0,p=h;l<v;)g=t(g=r(s,l),e),g=t(g=f(g,15),c),p=t(p=f(p^=g,13),5)+i,l+=4;switch(g=0,d){case 3:g^=(255&s.charCodeAt(l+2))<<16;case 2:g^=(255&s.charCodeAt(l+1))<<8;case 1:g=t(g^=255&s.charCodeAt(l),e),p^=g=t(g=f(g,15),c)}return p^=s.length,p=t(p^=p>>>16,u),p=t(p^=p>>>13,a),(p^=p>>>16)>>>0}}(),i=u;e.aleaRNGFactory=c,e.murmurHash=i,e.murmurhash2_x86_32=u,e.murmurhash3_x86_32=a,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import { murmurhash2_x86_32 } from '.'; | ||
import { murmurhash2_x86_32 } from "."; | ||
export default murmurhash2_x86_32; |
@@ -1,2 +0,2 @@ | ||
import { murmurhash3_x86_32 } from '.'; | ||
import { murmurhash3_x86_32 } from "."; | ||
export default murmurhash3_x86_32; |
{ | ||
"name": "number-generator", | ||
"version": "2.3.1", | ||
"version": "3.0.0", | ||
"description": "Generate pseudo random numbers and hashs.", | ||
@@ -9,3 +9,3 @@ "main": "lib/index.js", | ||
"engines": { | ||
"node": ">=6" | ||
"node": ">=8" | ||
}, | ||
@@ -18,6 +18,7 @@ "scripts": { | ||
"test:treeshaking": "agadoo lib/index.esm.js", | ||
"ci": "npm run lint && npm run test:prod && npm test", | ||
"ci": "npm run format:check && npm run lint && npm run test:prod && npm test", | ||
"coverage": "nyc report --reporter=text-lcov | coveralls", | ||
"lint": "eslint --ignore-path .prettierignore ./", | ||
"format": "prettier --write \"**/*.{js,md}\"", | ||
"format": "prettier --write \"**/*.{js,ts,md,json,yml}\"", | ||
"format:check": "prettier --list-different \"**/*.{js,ts,md,json,yml}\"", | ||
"commit": "git-cz", | ||
@@ -47,38 +48,38 @@ "prerelease": "npm run ci", | ||
"homepage": "https://github.com/MartinHelmut/number-generator#readme", | ||
"files": [ | ||
"lib" | ||
], | ||
"devDependencies": { | ||
"@babel/core": "7.2.2", | ||
"@babel/preset-env": "7.2.3", | ||
"@babel/register": "7.0.0", | ||
"@babel/core": "7.4.5", | ||
"@babel/preset-env": "7.4.5", | ||
"@babel/register": "7.4.4", | ||
"@types/chai": "4.1.7", | ||
"@types/mocha": "5.2.5", | ||
"@types/mocha": "5.2.7", | ||
"agadoo": "1.0.1", | ||
"chai": "4.2.0", | ||
"commitizen": "3.0.5", | ||
"coveralls": "3.0.2", | ||
"chalk": "2.4.2", | ||
"commitizen": "3.1.1", | ||
"coveralls": "3.0.4", | ||
"cpy": "7.3.0", | ||
"cross-env": "5.2.0", | ||
"cz-conventional-changelog": "2.1.0", | ||
"eslint": "5.12.1", | ||
"eslint-config-prettier": "3.5.0", | ||
"eslint-plugin-compat": "2.6.3", | ||
"husky": "1.3.1", | ||
"jsdoc": "3.5.5", | ||
"lint-staged": "8.1.0", | ||
"mocha": "5.2.0", | ||
"nyc": "13.1.0", | ||
"prettier": "1.15.3", | ||
"regenerator-runtime": "0.13.1", | ||
"rollup": "1.1.0", | ||
"rollup-plugin-babel": "4.3.1", | ||
"eslint": "5.16.0", | ||
"eslint-config-prettier": "5.0.0", | ||
"eslint-plugin-compat": "3.1.2", | ||
"jsdoc": "3.6.2", | ||
"mocha": "6.1.4", | ||
"nyc": "14.1.1", | ||
"prettier": "1.18.2", | ||
"regenerator-runtime": "0.13.2", | ||
"rollup": "1.16.1", | ||
"rollup-plugin-babel": "4.3.2", | ||
"rollup-plugin-clear": "2.0.7", | ||
"rollup-plugin-cpy": "1.1.0", | ||
"rollup-plugin-filesize": "6.0.0", | ||
"rollup-plugin-node-resolve": "4.0.0", | ||
"rollup-plugin-terser": "4.0.2", | ||
"standard-version": "4.4.0", | ||
"ts-node": "7.0.1", | ||
"typescript": "3.2.4" | ||
}, | ||
"files": [ | ||
"lib" | ||
] | ||
"rollup-plugin-filesize": "6.1.1", | ||
"rollup-plugin-node-resolve": "5.0.3", | ||
"rollup-plugin-terser": "5.0.0", | ||
"standard-version": "6.0.1", | ||
"ts-node": "8.3.0", | ||
"typescript": "3.5.2" | ||
} | ||
} |
@@ -14,20 +14,20 @@ # Number Generator | ||
- [Usage](#usage) | ||
- [Install](#install) | ||
- [Random numbers](#random-numbers) | ||
- [Create a new random number generator](#create-a-new-random-number-generator) | ||
- [Create an unsigned integer](#create-an-unsigned-integer) | ||
- [Create an unsigned float](#create-an-unsigned-float) | ||
- [Change the seed](#change-the-seed) | ||
- [Get the state](#get-the-state) | ||
- [Set the state](#set-the-state) | ||
- [Something like Math.random?](#something-like-mathrandom) | ||
- [Generate hash](#generate-hash) | ||
- [Basic hash generation](#basic-hash-generation) | ||
- [Hash based on different seeds](#hash-based-on-different-seeds) | ||
- [Compatibility to v1](#compatibility-to-v1) | ||
- [TypeScript](#typescript) | ||
- [Support](#support) | ||
- [Development](#development) | ||
- [Disclaimer](#disclaimer) | ||
- [Usage](#usage) | ||
- [Install](#install) | ||
- [Random numbers](#random-numbers) | ||
- [Create a new random number generator](#create-a-new-random-number-generator) | ||
- [Create an unsigned integer](#create-an-unsigned-integer) | ||
- [Create an unsigned float](#create-an-unsigned-float) | ||
- [Change the seed](#change-the-seed) | ||
- [Get the state](#get-the-state) | ||
- [Set the state](#set-the-state) | ||
- [Something like Math.random?](#something-like-mathrandom) | ||
- [Generate hash](#generate-hash) | ||
- [Basic hash generation](#basic-hash-generation) | ||
- [Hash based on different seeds](#hash-based-on-different-seeds) | ||
- [Compatibility to v1](#compatibility-to-v1) | ||
- [TypeScript](#typescript) | ||
- [Support](#support) | ||
- [Development](#development) | ||
- [Disclaimer](#disclaimer) | ||
@@ -54,6 +54,6 @@ --- | ||
// ESM | ||
import * as numberGenerator from 'number-generator'; | ||
import * as numberGenerator from "number-generator"; | ||
// CJS | ||
const numberGenerator = require('number-generator'); | ||
const numberGenerator = require("number-generator"); | ||
``` | ||
@@ -65,10 +65,10 @@ | ||
// ESM | ||
import aleaRNGFactory from 'number-generator/lib/aleaRNGFactory'; | ||
import murmurhash2_x86_32 from 'number-generator/lib/murmurhash2_x86_32'; | ||
import murmurhash3_x86_32 from 'number-generator/lib/murmurhash3_x86_32'; | ||
import aleaRNGFactory from "number-generator/lib/aleaRNGFactory"; | ||
import murmurhash2_x86_32 from "number-generator/lib/murmurhash2_x86_32"; | ||
import murmurhash3_x86_32 from "number-generator/lib/murmurhash3_x86_32"; | ||
// CJS | ||
const aleaRNGFactory = require('number-generator/lib/aleaRNGFactory'); | ||
const murmurhash2_x86_32 = require('number-generator/lib/murmurhash2_x86_32'); | ||
const murmurhash3_x86_32 = require('number-generator/lib/murmurhash3_x86_32'); | ||
const aleaRNGFactory = require("number-generator/lib/aleaRNGFactory"); | ||
const murmurhash2_x86_32 = require("number-generator/lib/murmurhash2_x86_32"); | ||
const murmurhash3_x86_32 = require("number-generator/lib/murmurhash3_x86_32"); | ||
``` | ||
@@ -81,3 +81,3 @@ | ||
// will only put this function with helpers in your bundle: | ||
import { aleaRNGFactory } from 'number-generator'; | ||
import { aleaRNGFactory } from "number-generator"; | ||
``` | ||
@@ -91,3 +91,3 @@ | ||
// Direct browser usage e.g.: | ||
numberGenerator.murmurhash2_x86_32('something'); | ||
numberGenerator.murmurhash2_x86_32("something"); | ||
``` | ||
@@ -106,3 +106,3 @@ | ||
```javascript | ||
const aleaRNGFactory = require('number-generator/lib/aleaRNGFactory'); | ||
const aleaRNGFactory = require("number-generator/lib/aleaRNGFactory"); | ||
``` | ||
@@ -250,5 +250,5 @@ | ||
```javascript | ||
const murmurhash2_x86_32 = require('number-generator/lib/murmurhash2_x86_32'); | ||
const murmurhash2_x86_32 = require("number-generator/lib/murmurhash2_x86_32"); | ||
// or | ||
const murmurhash3_x86_32 = require('number-generator/lib/murmurhash3_x86_32'); | ||
const murmurhash3_x86_32 = require("number-generator/lib/murmurhash3_x86_32"); | ||
``` | ||
@@ -261,4 +261,4 @@ | ||
```javascript | ||
const hash1 = murmurhash2_x86_32('My string.'); | ||
const hash2 = murmurhash2_x86_32('My string.', 0); | ||
const hash1 = murmurhash2_x86_32("My string."); | ||
const hash2 = murmurhash2_x86_32("My string.", 0); | ||
@@ -276,4 +276,4 @@ hash1; // 1836966117 | ||
```javascript | ||
const hash1 = murmurhash2_x86_32('My string.', 1); | ||
const hash2 = murmurhash2_x86_32('My string.', 2); | ||
const hash1 = murmurhash2_x86_32("My string.", 1); | ||
const hash2 = murmurhash2_x86_32("My string.", 2); | ||
@@ -286,3 +286,3 @@ hash1 === hash2; // false | ||
```javascript | ||
const hash = murmurhash2_x86_32('My string.', 0.7); // TypeError! | ||
const hash = murmurhash2_x86_32("My string.", 0.7); // TypeError! | ||
``` | ||
@@ -295,3 +295,3 @@ | ||
```javascript | ||
const { murmurHash } = require('number-generator'); | ||
const { murmurHash } = require("number-generator"); | ||
``` | ||
@@ -305,8 +305,8 @@ | ||
import { | ||
NumberGenerator, | ||
NumberHashGenerator, | ||
aleaRNGFactory, | ||
murmurhash2_x86_32, | ||
murmurhash3_x86_32 | ||
} from 'number-generator'; | ||
NumberGenerator, | ||
NumberHashGenerator, | ||
aleaRNGFactory, | ||
murmurhash2_x86_32, | ||
murmurhash3_x86_32 | ||
} from "number-generator"; | ||
@@ -320,4 +320,4 @@ const generator: NumberGenerator = aleaRNGFactory(); | ||
generator.uInt32(); | ||
hashFn1('What?', 42); | ||
hashFn2('something', 14); | ||
hashFn1("What?", 42); | ||
hashFn2("something", 14); | ||
``` | ||
@@ -329,4 +329,4 @@ | ||
- Node >= 6 | ||
- All major browsers and IE >= 9 | ||
- Node >= 8 | ||
- All major browsers and IE >= 10 | ||
@@ -333,0 +333,0 @@ Exceptions for Node are versions that reached the End-of-Life as defined under https://github.com/nodejs/Release#end-of-life-releases. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
96135
3.64%62
5.08%