{"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.11.0","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":"2646d3b7d79bba66c4a5930c52ae99a30a9767db","bugs":{"url":"https://github.com/xtuc/webassemblyjs/issues"},"homepage":"https://github.com/xtuc/webassemblyjs#readme","_id":"@webassemblyjs/floating-point-hex-parser@1.11.0","_nodeVersion":"12.2.0","_npmVersion":"lerna/3.13.4/node@v12.2.0+x64 (linux)","dist":{"integrity":"sha512-Q/aVYs/VnPDVYvsCBL/gSgwmfjeCb4LW8+TMrO3cSzJImgv8lxxEPM2JA5jMrivE7LSz3V+PFqtMbls3m1exDA==","shasum":"34d62052f453cd43101d72eab4966a022587947c","tarball":"http://registry-npm.ywwl.com/@webassemblyjs/floating-point-hex-parser/download/@webassemblyjs/floating-point-hex-parser-1.11.0.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\nwsFcBAEBCAAQBQJf907RCRA9TVsSAnZWagAAJtwP/1xabOezbgSvy3MO+bAQ\n0/iE3uP1NcnS05/G+b42yCFVz9g1nRUj4HXPSKHHUSPUcvvWOXA7Z3ckt0G1\nhp6XukkC3zgY6Pk/bPlZOFvhCXnCpfiZ9WsTgeS9TdyNcdP5WWjhIwL1PJHU\n0o0A08Y+9Mk6BdjWBpjXtQNUVK1LJnOeY9/Sma+rA0WWngGsmI3M9X9HO4ig\nVzkovI16535fwHUaW3h4BAxY++bQ5MRh8NUxYhDKfJcGmKr+OrR9eSLCuQQM\nq7ACg2OxMq16HuLvyKGLxHlv+l0n9Athfw9E9L1LakLrXA2qcLZ+qcYDDVLx\n13cdNZkkwIowZ0FZZiQR/YULvrIXZJ2PVPpoorg5I9J3J+90TBiLq4nOSC8Q\naDYDflqmjvkhM2196g2bRXrQMci7LRzmlP2lGzQze1Y4eaH7CtgqW3UFINNw\nDNAn/dp7GEcJIx9wBXfnZL3si82bYjGDkWCIhJV3ZrjSIU73BUguGj0Pq/MV\nQHQJH+paEs/wlx/tkxuNuGqS3VgpJHg+ppyvocd5P1do0S99pm9XOAlgZZYH\ngB0qas7tUbhNRXgVjCa9QrXFzo+bhdyz/hDSO3ZRY/YnsYHKtUmOwZhzW/Qv\nJDm99YBIhlThb8pW89SSZJ1OMRVxHT2Kaa9jGxHYfXE9nNZ3M+MhsKCz+eOS\n81+p\r\n=/dCV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4edKHHoC9+EDGYwxpe7oQiTt/1BtEUoKkpAkQ3OzwWAIgYptTeXjlUL0lj0bg9egCZ9Bk2sjTV3uI2YmUZYnp/Sk="}],"size":2533,"noattachment":false,"key":"/@webassemblyjs/floating-point-hex-parser/-/@webassemblyjs/floating-point-hex-parser-1.11.0.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.11.0_1610043088807_0.907491157892597"},"_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":1610043088966,"_cnpm_publish_time":1610043088966,"dist-tags":{"latest":"1.14.1"}}