{"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.7.0-2","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","bugs":{"url":"https://github.com/xtuc/webassemblyjs/issues"},"homepage":"https://github.com/xtuc/webassemblyjs#readme","_id":"@webassemblyjs/floating-point-hex-parser@1.7.0-2","_npmVersion":"5.5.1","_nodeVersion":"9.3.0","_npmUser":{"name":"xtuc","email":"contact@xtuc.fr"},"dist":{"integrity":"sha512-gdv+uNgU482fNn0YNXQYHaQaUdCrETszEe3hJOSlOADD3Wz0Gs5G9KSZRzCqhem0y0Fqc5dVQogL/9X/p5Kohw==","shasum":"b2cea8dbe7d97d9be6ab0b00803c49f9464f9bbf","tarball":"http://registry-npm.ywwl.com/@webassemblyjs/floating-point-hex-parser/download/@webassemblyjs/floating-point-hex-parser-1.7.0-2.tgz","fileCount":5,"unpackedSize":6243,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbT1lFCRA9TVsSAnZWagAAywoP/3KaUfcdR3BkHCOJZiQM\nHtnLKoGWiQDyUY+1T43S2uXTseLys81LHaBsKu0pUVVNgSiAZ+SEl0Os3fNF\nFX2JKhX+dDIcaUWa9/7qkBSq3wOTqPYth5OuHIDGlQhQwi7wRnVk7kT0r0jD\nf2D8CwpdHY88KB6RnmRMeXEstBRF5OP5yTY9MXwilZvFL7QLQD8kBdaLLADV\ntMrP8tvki1CGc0yWM8abL26AmVrNygDBYMpOuIagXl5SXlg1d8OrbWq1x3Q/\nSOEbOwP7NZmIzoOe08D6E1cyJpl2fFXXuUuYWceAjGhWlVq7Uqy1su/F00/a\n8qYOjzXo8vlEI7Vp8zNz7yfIYjmQ+54EH7zTEXlMeFryKuXSzOoD0nHSwwBm\nhC8Gqyy307EwWZTQTY04n3Ahp0ijroGWZCAFowMlBc+TIzaS1J2Ri9SwT7yO\niXWgsuS0ltuXGSsLd+o0nzt645B7zmAR8bLssqBlMStC7Eh5m2Xg8ln4rWY7\n+Xa34PPOGiguHzcOvXh6ibzO7qJhU7K/kGqoqlGrTzcxIDXT64qwiIz9uPqi\nyTrx+hg++10j564HLrrymbGw8OpcYGbOia6n4Ig42ChBpRuHb7uxUXXDjCNx\nF9moDilyB8o2oRBR6+WjvdOET2zW67B5UoyfVsYbQsSByhWtytqfDpx65KX1\nP8dz\r\n=UrjP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1m21FrAR6ZUip/RCLseMfv2GfcvNLSjgJiVe0ux5vLAIhAINfthjvWtIMeznf0DFYvE2PXfg+6x5zHDKxi8z+/u1G"}],"size":2451,"noattachment":false,"key":"/@webassemblyjs/floating-point-hex-parser/-/@webassemblyjs/floating-point-hex-parser-1.7.0-2.tgz"},"maintainers":[{"name":"xtuc","email":"contact@xtuc.fr"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/floating-point-hex-parser_1.7.0-2_1531926853001_0.6915564998804453"},"_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":1531926853055,"_cnpm_publish_time":1531926853055,"dist-tags":{"latest":"1.14.1"}}