{"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.4.1","description":"A function to parse floating point hexadecimal strings as defined by the WebAssembly specification","main":"lib/index.js","keywords":["webassembly","floating-point"],"author":{"name":"Mauro Bringolf"},"license":"MIT","bugs":{"url":"https://github.com/xtuc/webassemblyjs/issues"},"homepage":"https://github.com/xtuc/webassemblyjs#readme","_id":"@webassemblyjs/floating-point-hex-parser@1.4.1","_npmVersion":"5.4.2","_nodeVersion":"6.11.4","_npmUser":{"name":"xtuc","email":"contact@xtuc.fr"},"dist":{"integrity":"sha512-3whpqgLaeIZIllhl5l09A/w0SgsQF/ZVu/gyss95XEtcQQrulXQ2hvGgCx8iolP90F59plUkS7XO7wQy1aX4aA==","shasum":"f6aca087e185097472007961e8b8bd58e042f084","tarball":"http://registry-npm.ywwl.com/@webassemblyjs/floating-point-hex-parser/download/@webassemblyjs/floating-point-hex-parser-1.4.1.tgz","fileCount":4,"unpackedSize":5028,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa9KERCRA9TVsSAnZWagAAL+wQAJBON2AUvT02hpGuck12\nk1XEmBvcTlU06K7Hhh3ff9uuC90/zBX24AutTrK6o+LdiiM8ehaK8ZQptacl\nn32FoGymZp+QjQDi7bnOK8ZD1QUKLErmEKRSkzb8maBMSQt8teQ352LehSiy\nb3y3tpAG5cAjQm11zlpAuTYxAim8TkICnti3FwYcFtVQyTFD6R+2sRTFPqlj\nc6+r+fUnYSBw2nUBXXprECxasgPAaXgnOScZlYS9KVE4cX67cGDoTm7BbeJ4\nsW2ydfd/ApV32qSa80EbZ02r5e05Kr82Q9ZZMsRU4PQWzRhLl8dJPm89RW8+\nkDikRUHLAkToAWlyjVBBe1NBn6RQbVS8kDh68E6zJQ/Y4Lh/JSRwD/IUYySd\n0RmlpVjNibCwzMx8uWJJz9BYrw6x1QEo48tashtApZX1gefx1S3n6WE0We0w\n2Pg94OtMFWEh6ZuS22/66U4Mq0QzmKIG2eArULLHIm65ioOwONBWEkc4lrQJ\nF+ECtlUxuLo6rCIzV2IeK7scs8OGTzpoaDWr7ld6J2Y6qq+CZ0Cve0/KwL85\n4RT/3+D8ur/N5Lk1tZKRFqp0F1zZXoXegnrCHotGSIX1IZUMY5tlg0lYPSpV\nhLihQziW8HDtUKMzGYL2SDdVOFdAdzzUTTD4FsYtHH414x4slgDmfDy4cRm1\nOcg7\r\n=QJMO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8qtBwbmfjUVg8zJTMJnLsrZMJLwEETIGWaEPX5xPzZwIhAKcJP8HXh/whN9aozNtEtXvduiexbDauLmRdUVsWt/DV"}],"size":2400,"noattachment":false,"key":"/@webassemblyjs/floating-point-hex-parser/-/@webassemblyjs/floating-point-hex-parser-1.4.1.tgz"},"maintainers":[{"name":"xtuc","email":"contact@xtuc.fr"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/floating-point-hex-parser_1.4.1_1525981456117_0.3778997661162722"},"_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":1525981456200,"_cnpm_publish_time":1525981456200,"dist-tags":{"latest":"1.14.1"}}