{"name":"@webassemblyjs/floating-point-hex-parser","scripts":{"pretest":"[ -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.2.7","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.2.7","_npmVersion":"5.4.2","_nodeVersion":"6.11.4","_npmUser":{"name":"xtuc","email":"contact@xtuc.fr"},"dist":{"integrity":"sha512-CG6lCtgmpuV9k5yaARiZV4KVs+5B2FY6BZTZiX0ykI7q6rvyT373nXYW4Qkp1BLNBW/knI0UVCiFnu8AyAA7QA==","shasum":"a6dd3fbcd016a3af4f358b7ed01eed1901b8aada","tarball":"http://registry-npm.ywwl.com/@webassemblyjs/floating-point-hex-parser/download/@webassemblyjs/floating-point-hex-parser-1.2.7.tgz","fileCount":5,"unpackedSize":6226,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa5ytpCRA9TVsSAnZWagAAPbgP/i+gjVD0etQbSR3gC75t\n/hlGyUsZMRJQ7HxuGSViiJx+fui2rUuTZtb3MXhjAgyahQMu56iCAb6E8Uwa\n6PuxaS3DwJMbGzJreX+wSLsvqJ8X8BlGuol5zPEjtE7JWUwB02IZ/8+M3U8K\nLDFSJBtaOsbempjx/k7JZ5onDU0aVEM09Q3c/TrF3IloJTqo6LV21P5Rgr3f\ngUHps6luiuOtYvVDsGGQhnNPlyGzYe0zR4xGeTT0/5mGcqJB8kN/CI7zL8sP\nZhtU3bxtFvjK5XYAvnPcyAZnaKElerm6EaUZH9y9/Uae9nk44Vt3yZ1lvfUr\nErDT5v2Qwejaffrkhr3BPNWHEdzRs2RSPN/zGAeDdN9XTh/Efu3UcaS122Hb\nKmAbFx5fuQ6Qr1eIvMZZfvugQyxU9ZV42BPlowpuihLVOrbpiwGLKdUq5Ot+\n7Ml68BzLWvr/0SYH4u3klWsGPv0qumJfIj16oa2GSgiRmR5d096IQ+85KL76\nFxoTpSMIE5WTVQXmJmcEWhuyorK+gFXg3mdep7K67HNnvjGfxihAyJlGv90f\ndVzvx9mjI6zUMRgjbsdmNLHiwFFV8aapuhN/DvVJ3XbTL8+NWCucgvhXShsj\nAK7sIJg+R2tTHY++zW8T+EE1FlnR2jQz0XFANo3xYjlQbaT2zrTR7+7diqL/\ngyLW\r\n=XmCm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDNdBqc7Xcc6FEICKIHpRgVRDONqaeMLjET7IrMRMdpowIgWL4PquAaFBQWnhWBq/yHV0KLUt9lpv8GXpQPZODsjWc="}],"size":2482,"noattachment":false,"key":"/@webassemblyjs/floating-point-hex-parser/-/@webassemblyjs/floating-point-hex-parser-1.2.7.tgz"},"maintainers":[{"name":"xtuc","email":"contact@xtuc.fr"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/floating-point-hex-parser_1.2.7_1525099368581_0.03907871422257303"},"_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":1525099368720,"_cnpm_publish_time":1525099368720,"dist-tags":{"latest":"1.14.1"}}