{"name":"@webassemblyjs/floating-point-hex-parser","scripts":{"build-fuzzer":"[ -f ./test/fuzzing/parse.out ] || gcc ./test/fuzzing/parse.c -o ./test/fuzzing/parse.out -lm -Wall"},"repository":{"type":"git","url":"git+https://github.com/xtuc/webassemblyjs.git"},"publishConfig":{"access":"public"},"version":"1.10.1","description":"A function to parse floating point hexadecimal strings as defined by the WebAssembly specification","main":"lib/index.js","module":"esm/index.js","keywords":["webassembly","floating-point"],"author":{"name":"Mauro Bringolf"},"license":"MIT","gitHead":"f723f2cdd9bfccb5e199962dd8c5c09bdb0faca4","bugs":{"url":"https://github.com/xtuc/webassemblyjs/issues"},"homepage":"https://github.com/xtuc/webassemblyjs#readme","_id":"@webassemblyjs/floating-point-hex-parser@1.10.1","_nodeVersion":"12.2.0","_npmVersion":"lerna/3.13.4/node@v12.2.0+x64 (linux)","dist":{"integrity":"sha512-ELUYKRw4vDJXnanwuN77JqcKK8aV98Zy0QImZs+DH19o3AmwlguLleNa25UpzQd5mzEAUc1xCyOLNR3se33jTg==","shasum":"b5b3de3255ff9ee32d5383b1ad5f7d986ccb41a3","tarball":"http://registry-npm.ywwl.com/@webassemblyjs/floating-point-hex-parser/download/@webassemblyjs/floating-point-hex-parser-1.10.1.tgz","fileCount":5,"unpackedSize":6370,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9zqUCRA9TVsSAnZWagAAekQQAJXBwGuXvurC/5b5Tuhw\nKsWvXqKMO1Y/hTvyEZBrCl5ox4pBwt5wZs6vVUq8FZ2v6WKxoUT2Tck937vb\nfP3D7gAiw/pbrIOdXbRgzOX5LCT176tR5Kq9u2PY1u6aRwP4yDf9wa9fdjg5\n0YrcnFjOy57+tuS/vwDCMWlrNMyqNgCMlqcLRjKI+VYuZ9na6Ga1WcCB3+TL\nrT2QIKT8wsH3/m5iEwQkfG2zPWMFd0rn0WonRSnFJ2JjE0DgSEFW+9dLIa6k\nHxTksvZZ9LlaEy2F+sLB4Vnl25tpQ7fPPdvC5L5zk7//Vf4Ak4SAs7fWRVv7\ndXixFq+fGp/YoQGacxafh7mBKIke85e9015XdETWsj4a+KylXzeVpuC1VdYw\nj3ZFjEn8DrnHtnZoo8NPlZWLraiqoXrgMyRA52Weuvfgrv/Ni7DjFJjxBlXA\nWS4zHMDvSCQDT2FT6wVtRSOKV4xPJCdo/0lCAoStEuV878i6JVw0uOQvs5qI\nkRel9DFYJG3WwO1NEAlXYqNq8fivJRUus/V5sGvdA+2XtyZbnPl8XM1ph4/G\nyNFC7U841BohCtDV3ZBJVAXM094mLXtq5W+ahMNk1rV1em6AfPmbqZ8tVp/g\nWYG6sqq1bZecNZq72XVJv61FVGfLqDekbbUwZEvH826M4bxDM9Y7tZf7oUHi\nTe/h\r\n=FrYg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDnOIkzcpkSOKIbWrC2IHO0GaZwXAvKCflpHAgghlBU4QIgF+S3F26IJDsnfX+DQdmOiaLYFlJfocuMq6frLpW9nbs="}],"size":2532,"noattachment":false,"key":"/@webassemblyjs/floating-point-hex-parser/-/@webassemblyjs/floating-point-hex-parser-1.10.1.tgz"},"_npmUser":{"name":"xtuc","email":"npm@sauleau.com"},"directories":{},"maintainers":[{"name":"xtuc","email":"npm@sauleau.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/floating-point-hex-parser_1.10.1_1610037907704_0.14199779493855913"},"_hasShrinkwrap":false,"readme":"# Parser function for floating point hexadecimals\n\n[![license](https://img.shields.io/github/license/maurobringolf/@webassemblyjs/floating-point-hex-parser.svg)]()\n[![GitHub last commit](https://img.shields.io/github/last-commit/maurobringolf/@webassemblyjs/floating-point-hex-parser.svg)]()\n[![npm](https://img.shields.io/npm/v/@webassemblyjs/floating-point-hex-parser.svg)]()\n\n> A 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 '@webassemblyjs/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/@webassemblyjs/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/@webassemblyjs/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","publish_time":1610037908041,"_cnpm_publish_time":1610037908041,"dist-tags":{"latest":"1.14.1"}}