{"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.4","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":"5fd2425602b752576bbe8089c343d5d70ebc861c","bugs":{"url":"https://github.com/xtuc/webassemblyjs/issues"},"homepage":"https://github.com/xtuc/webassemblyjs#readme","_id":"@webassemblyjs/floating-point-hex-parser@1.11.4","_nodeVersion":"16.13.0","_npmVersion":"lerna/5.1.6/node@v16.13.0+x64 (linux)","dist":{"integrity":"sha512-/XkrDSSzPs+PCx//2jTMvrQvdSlBXSkfT+Z3z5avt0Yw0+vfLbsfTOSt+Jp5kZ0qwjIV+MRcgUy/YWg6Z2/SRg==","shasum":"45ab78d748d210566388212a1edd4af7f86a1217","tarball":"http://registry-npm.ywwl.com/@webassemblyjs/floating-point-hex-parser/download/@webassemblyjs/floating-point-hex-parser-1.11.4.tgz","fileCount":5,"unpackedSize":6373,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBjbFUZozg7yJmpNI6q6bTuLZzaxGGbwId3D1/CgL7sLAiBQ0mb0le4pmq8GVPAdZXZaG/ZzaNJlDUCwv1j56YF5Tg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiwDGVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoDLA//RIfO8GR5kizsY3vxK5r/sunkgD7PdZ8Vl/97uGBzACGTjrVn\r\nifnBsjF3ThdieyKork9oqMjBVWmDUZppM7NQxMA/NAORuVNqk7wpYkTZdmCC\r\ngnrnVkbi/FjO57jIMAq+UMOxvvnwZFvJ8p5RYz9DUM/8HU34krlnWw1zx0/3\r\nSFd/XEU6pb0BLjogJbdDD8tgbomgwSLzGl/FpCU7YFz3F2pGalFRKWULkdFM\r\nyOHkiWV59Kgr7mQWGBwxODveDyBX26/xSXAUyrzifDZ7SkrCvelB61evM+Vj\r\ncD1x/DAMi9JgDSZyZfYbIJeJCdGuI1drLlR6ozhx8lOQNvUEq7AynG6lukj8\r\nPgR4MIPZy9mzL6FzHvqAwux2ldNSilyQXo5/bkUj0LX/xLD2sqFalkqRhbPp\r\nVkYYIPKV3kPm1csRMRayv9b9PIYQJyqe3oI5PpEXKG9T4WouEY0SPmBt1WOv\r\nZTuBD2vV/DLUEUOVceexCH7lKltRoK//PIz2ic5cMq+Q7T9ak8Xc6/NVaSmL\r\nPYSjLmCN8pfqyK88QU40B7tloYsJFphC4Uebs7VqPKcFCXU/Q90+bhBcyUIj\r\nyEvisvAGvqmftNgNcFjnKiZwshGaexXvO23QFH9lNCNf+fgTTSTcllfAJlPw\r\nmLll2RFm1PQPGsMxN3elDMkKIRxeQDqDxXA=\r\n=rxiu\r\n-----END PGP SIGNATURE-----\r\n","size":2531,"noattachment":false,"key":"/@webassemblyjs/floating-point-hex-parser/-/@webassemblyjs/floating-point-hex-parser-1.11.4.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.4_1656762773757_0.3771891676534649"},"_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":1656762773941,"_cnpm_publish_time":1656762773941,"dist-tags":{"latest":"1.14.1"}}