{"_id":"webassembly-floating-point-hex-parser","_rev":"140593","name":"webassembly-floating-point-hex-parser","description":"A function to parse floating point hexadecimal strings as defined by the WebAssembly specification","dist-tags":{"latest":"0.1.3"},"maintainers":[{"name":"maurobringolf","email":"mauro@bringolf.com"}],"time":{"modified":"2021-06-03T11:26:39.000Z","created":"2017-12-30T20:19:29.417Z","0.1.3":"2018-01-07T11:10:39.693Z","0.1.2":"2017-12-31T16:26:38.752Z","0.1.1":"2017-12-31T11:49:34.520Z","0.1.0":"2017-12-30T20:19:29.417Z"},"users":{},"author":{"name":"Mauro Bringolf"},"repository":{"type":"git","url":"git+https://github.com/maurobringolf/webassembly-floating-point-hex-parser.git"},"versions":{"0.1.3":{"name":"webassembly-floating-point-hex-parser","bugs":{"url":"https://github.com/maurobringolf/webassembly-floating-point-hex-parser/issues"},"contributors":[{"name":"maurobringolf"}],"engines":{"node":"*"},"repository":{"type":"git","url":"git+https://github.com/maurobringolf/webassembly-floating-point-hex-parser.git"},"homepage":"https://github.com/maurobringolf/webassembly-floating-point-hex-parser","version":"0.1.3","description":"A function to parse floating point hexadecimal strings as defined by the WebAssembly specification","main":"lib/index.js","scripts":{"build":"babel src -d lib","prepublishOnly":"npm run build","watch":"jest --watch *.js","test":"jest","postbuild":"NODE_ENV=PRODUCTION jest","pretest":"gcc ./test/fuzzing/parse.c -o ./test/fuzzing/parse.out -lm -Wall"},"keywords":["webassembly","floating-point"],"author":{"name":"Mauro Bringolf"},"license":"MIT","dependencies":{},"devDependencies":{"babel-cli":"^6.26.0","babel-preset-env":"^1.6.1","babel-preset-minify":"^0.2.0","jest":"^22.0.4"},"gitHead":"ef9a08b0657d8f00aa23aeae181a1733df43a43c","_id":"webassembly-floating-point-hex-parser@0.1.3","_npmVersion":"5.6.0","_nodeVersion":"8.9.1","_npmUser":{"name":"maurobringolf","email":"mauro@bringolf.com"},"dist":{"shasum":"e68443bac8d4a216e5dfbf5858c90c834a7bec3f","size":4428,"noattachment":false,"key":"/webassembly-floating-point-hex-parser/-/webassembly-floating-point-hex-parser-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/webassembly-floating-point-hex-parser/download/webassembly-floating-point-hex-parser-0.1.3.tgz"},"maintainers":[{"name":"maurobringolf","email":"mauro@bringolf.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webassembly-floating-point-hex-parser-0.1.3.tgz_1515323439610_0.05415981193073094"},"directories":{},"publish_time":1515323439693,"_hasShrinkwrap":false,"_cnpm_publish_time":1515323439693},"0.1.2":{"name":"webassembly-floating-point-hex-parser","bugs":{"url":"https://github.com/maurobringolf/webassembly-floating-point-hex-parser/issues"},"contributors":[{"name":"maurobringolf"}],"engines":{"node":"*"},"repository":{"type":"git","url":"git+https://github.com/maurobringolf/webassembly-floating-point-hex-parser.git"},"homepage":"https://github.com/maurobringolf/webassembly-floating-point-hex-parser","version":"0.1.2","description":"A function to parse floating point hexadecimal strings as defined by the WebAssembly specification","main":"lib/index.js","scripts":{"build":"babel src -d lib","prepublishOnly":"npm run build","watch":"jest --watch *.js","test":"jest","postbuild":"NODE_ENV=PRODUCTION jest","pretest":"gcc ./test/fuzzing/parse.c -o ./test/fuzzing/parse.out -lm -Wall"},"keywords":["webassembly","floating-point"],"author":{"name":"Mauro Bringolf"},"license":"ISC","dependencies":{},"devDependencies":{"babel-cli":"^6.26.0","babel-preset-env":"^1.6.1","babel-preset-minify":"^0.2.0","jest":"^22.0.4"},"gitHead":"acadba1ac9921152f0f819ed78a257090645e5cb","_id":"webassembly-floating-point-hex-parser@0.1.2","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"maurobringolf","email":"mauro@bringolf.com"},"dist":{"shasum":"85bb01f54e68690c2645ea0cfad26c1110fdf988","size":4383,"noattachment":false,"key":"/webassembly-floating-point-hex-parser/-/webassembly-floating-point-hex-parser-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/webassembly-floating-point-hex-parser/download/webassembly-floating-point-hex-parser-0.1.2.tgz"},"maintainers":[{"name":"maurobringolf","email":"mauro@bringolf.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webassembly-floating-point-hex-parser-0.1.2.tgz_1514737598652_0.9213068727403879"},"directories":{},"publish_time":1514737598752,"_hasShrinkwrap":false,"_cnpm_publish_time":1514737598752},"0.1.1":{"name":"webassembly-floating-point-hex-parser","bugs":{"url":"https://github.com/maurobringolf/webassembly-floating-point-hex-parser/issues"},"contributors":[{"name":"maurobringolf"}],"engines":{"node":"*"},"repository":{"type":"git","url":"git+https://github.com/maurobringolf/webassembly-floating-point-hex-parser.git"},"homepage":"https://github.com/maurobringolf/webassembly-floating-point-hex-parser","version":"0.1.1","description":"A function to parse floating point hexadecimal strings as defined by the WebAssembly specification","main":"lib/index.js","scripts":{"build":"babel src -d lib","prepublishOnly":"npm run build","watch":"jest --watch *.js","test":"jest","postbuild":"NODE_ENV=PRODUCTION jest"},"keywords":["webassembly","floating-point"],"author":{"name":"Mauro Bringolf"},"license":"ISC","dependencies":{},"devDependencies":{"babel-cli":"^6.26.0","babel-preset-env":"^1.6.1","babel-preset-minify":"^0.2.0","jest":"^22.0.4"},"gitHead":"0f0d2f3c91498a1385679323986c1f8a9e76c380","_id":"webassembly-floating-point-hex-parser@0.1.1","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"maurobringolf","email":"mauro@bringolf.com"},"dist":{"shasum":"5e4185414b37f2fd1fbe89cb88b76779cbb693ee","size":3429,"noattachment":false,"key":"/webassembly-floating-point-hex-parser/-/webassembly-floating-point-hex-parser-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/webassembly-floating-point-hex-parser/download/webassembly-floating-point-hex-parser-0.1.1.tgz"},"maintainers":[{"name":"maurobringolf","email":"mauro@bringolf.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webassembly-floating-point-hex-parser-0.1.1.tgz_1514720973649_0.3908765623345971"},"directories":{},"publish_time":1514720974520,"_hasShrinkwrap":false,"_cnpm_publish_time":1514720974520},"0.1.0":{"name":"webassembly-floating-point-hex-parser","bugs":{"url":"https://github.com/maurobringolf/webassembly-floating-point-hex-parser/issues"},"contributors":[{"name":"maurobringolf"}],"engines":{"node":"*"},"repository":{"type":"git","url":"git+https://github.com/maurobringolf/webassembly-floating-point-hex-parser.git"},"homepage":"https://github.com/maurobringolf/webassembly-floating-point-hex-parser","version":"0.1.0","description":"A function to parse floating point hexadecimal strings as defined by the WebAssembly specification","main":"index.js","scripts":{"watch":"jest --watch *.js","test":"jest"},"keywords":["webassembly","floating-point"],"author":{"name":"Mauro Bringolf"},"license":"ISC","dependencies":{},"devDependencies":{"jest":"^22.0.4"},"gitHead":"f58efcd7e521c002cd6313be766b49b1344a6ad2","_id":"webassembly-floating-point-hex-parser@0.1.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"maurobringolf","email":"mauro@bringolf.com"},"dist":{"shasum":"e08ff344afeaea2988212d64f23c64e54a9a6eb5","size":2929,"noattachment":false,"key":"/webassembly-floating-point-hex-parser/-/webassembly-floating-point-hex-parser-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/webassembly-floating-point-hex-parser/download/webassembly-floating-point-hex-parser-0.1.0.tgz"},"maintainers":[{"name":"maurobringolf","email":"mauro@bringolf.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webassembly-floating-point-hex-parser-0.1.0.tgz_1514665168508_0.3542597882915288"},"directories":{},"publish_time":1514665169417,"_hasShrinkwrap":false,"_cnpm_publish_time":1514665169417}},"readme":"# Parser function for floating point hexadecimals\n\n[![CircleCI](https://img.shields.io/circleci/project/github/maurobringolf/webassembly-floating-point-hex-parser/master.svg)]()\n[![Github file size](https://img.shields.io/github/size/maurobringolf/webassembly-floating-point-hex-parser/lib/index.js.svg)]()\n[![license](https://img.shields.io/github/license/maurobringolf/webassembly-floating-point-hex-parser.svg)]()\n[![GitHub last commit](https://img.shields.io/github/last-commit/maurobringolf/webassembly-floating-point-hex-parser.svg)]()\n[![npm](https://img.shields.io/npm/v/webassembly-floating-point-hex-parser.svg)]()\n\nA JavaScript function to parse floating point hexadecimals as defined by the [WebAssembly specification](https://webassembly.github.io/spec/core/text/values.html#text-hexfloat).\n\n## Usage\n\n```javascript\nimport parseHexFloat from 'webassembly-floating-point-hex-parser'\n\nparseHexFloat('0x1p-1')               // 0.5\nparseHexFloat('0x1.921fb54442d18p+2') // 6.283185307179586\n```\n\n## Tests\n\nThis module is tested in two ways. The first one is through a small set of test cases that can be found in [test/regular.test.js](https://github.com/maurobringolf/webassembly-floating-point-hex-parser/blob/master/test/regular.test.js). The second one is non-deterministic (sometimes called *fuzzing*):\n\n1. Generate a random IEEE754 double precision value `x`.\n1. Compute its representation `y` in floating point hexadecimal format using the C standard library function `printf` since C supports this format.\n1. Give both values to JS testcase and see if `parseHexFloat(y) === x`.\n\nBy default one `npm test` run tests 100 random samples. If you want to do more, you can set the environment variable `FUZZ_AMOUNT` to whatever number of runs you'd like. Because it uses one child process for each sample, it is really slow though. For more details about the randomized tests see [the source](https://github.com/maurobringolf/webassembly-floating-point-hex-parser/tree/master/test/fuzzing).\n\n## Links\n\n* [maurobringolf.ch/2017/12/hexadecimal-floating-point-notation/](https://maurobringolf.ch/2017/12/hexadecimal-floating-point-notation/)\n\n* [github.com/xtuc/js-webassembly-interpreter/issues/32](https://github.com/xtuc/js-webassembly-interpreter/issues/32)\n\n* [github.com/WebAssembly/design/issues/292](https://github.com/WebAssembly/design/issues/292)\n","_attachments":{},"homepage":"https://github.com/maurobringolf/webassembly-floating-point-hex-parser","bugs":{"url":"https://github.com/maurobringolf/webassembly-floating-point-hex-parser/issues"},"license":"MIT"}