{"_id":"webassembly-floating-point-hex-parser","_rev":"4-a863919ad182e71e9a3bb5658ae5b4ee","name":"webassembly-floating-point-hex-parser","description":"A function to parse floating point hexadecimal strings as defined by the WebAssembly specification","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"webassembly-floating-point-hex-parser","bugs":{"url":"https://github.com/maurobringolf/webassembly-floating-point-hex-parser/issues"},"contributors":[{"name":"maurobringolf"}],"engines":{"node":"*"},"repository":{"type":"git","url":"git+https://github.com/maurobringolf/webassembly-floating-point-hex-parser.git"},"homepage":"https://github.com/maurobringolf/webassembly-floating-point-hex-parser","version":"0.1.0","description":"A function to parse floating point hexadecimal strings as defined by the WebAssembly specification","main":"index.js","scripts":{"watch":"jest --watch *.js","test":"jest"},"keywords":["webassembly","floating-point"],"author":{"name":"Mauro Bringolf"},"license":"ISC","dependencies":{},"devDependencies":{"jest":"^22.0.4"},"gitHead":"f58efcd7e521c002cd6313be766b49b1344a6ad2","_id":"webassembly-floating-point-hex-parser@0.1.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"maurobringolf","email":"mauro@bringolf.com"},"dist":{"integrity":"sha512-SPDxT9NptvaTKIM0xltDp0xZx7q3GBbGUvi/7FbqueUwy9VUGyvc1RkkcSxr6QoYm7fRiBGarJn1VP7E5DIkZg==","shasum":"e08ff344afeaea2988212d64f23c64e54a9a6eb5","tarball":"https://registry.npmjs.org/webassembly-floating-point-hex-parser/-/webassembly-floating-point-hex-parser-0.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhASNXLznDEacez2WA99XOoMLLEWi/y/aTdiHmc/hTKgIgFa79EJuEuLN8iwKB5hoikyywkjnjhx/zYqoY54PL6uE="}]},"maintainers":[{"name":"maurobringolf","email":"mauro@bringolf.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webassembly-floating-point-hex-parser-0.1.0.tgz_1514665168508_0.3542597882915288"}},"0.1.1":{"name":"webassembly-floating-point-hex-parser","bugs":{"url":"https://github.com/maurobringolf/webassembly-floating-point-hex-parser/issues"},"contributors":[{"name":"maurobringolf"}],"engines":{"node":"*"},"repository":{"type":"git","url":"git+https://github.com/maurobringolf/webassembly-floating-point-hex-parser.git"},"homepage":"https://github.com/maurobringolf/webassembly-floating-point-hex-parser","version":"0.1.1","description":"A function to parse floating point hexadecimal strings as defined by the WebAssembly specification","main":"lib/index.js","scripts":{"build":"babel src -d lib","prepublishOnly":"npm run build","watch":"jest --watch *.js","test":"jest","postbuild":"NODE_ENV=PRODUCTION jest"},"keywords":["webassembly","floating-point"],"author":{"name":"Mauro Bringolf"},"license":"ISC","dependencies":{},"devDependencies":{"babel-cli":"^6.26.0","babel-preset-env":"^1.6.1","babel-preset-minify":"^0.2.0","jest":"^22.0.4"},"gitHead":"0f0d2f3c91498a1385679323986c1f8a9e76c380","_id":"webassembly-floating-point-hex-parser@0.1.1","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"maurobringolf","email":"mauro@bringolf.com"},"dist":{"integrity":"sha512-UTE1WZUR1d/8ZClWofVABZCWe8aTEysmnSXtryEarhCHWQOeh+djG9l6ySEEY4QNkeJy7/R0WMSaEOir0vkzRA==","shasum":"5e4185414b37f2fd1fbe89cb88b76779cbb693ee","tarball":"https://registry.npmjs.org/webassembly-floating-point-hex-parser/-/webassembly-floating-point-hex-parser-0.1.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCHFo5K8tsIz//1wOYnICzMum9hBzR7DEffnonw8ZbhvQIgH2Me9MXoBf5HA9BWdmWNdVcZ5pzqsLFEOSq+wmQltCw="}]},"maintainers":[{"name":"maurobringolf","email":"mauro@bringolf.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webassembly-floating-point-hex-parser-0.1.1.tgz_1514720973649_0.3908765623345971"}},"0.1.2":{"name":"webassembly-floating-point-hex-parser","bugs":{"url":"https://github.com/maurobringolf/webassembly-floating-point-hex-parser/issues"},"contributors":[{"name":"maurobringolf"}],"engines":{"node":"*"},"repository":{"type":"git","url":"git+https://github.com/maurobringolf/webassembly-floating-point-hex-parser.git"},"homepage":"https://github.com/maurobringolf/webassembly-floating-point-hex-parser","version":"0.1.2","description":"A function to parse floating point hexadecimal strings as defined by the WebAssembly specification","main":"lib/index.js","scripts":{"build":"babel src -d lib","prepublishOnly":"npm run build","watch":"jest --watch *.js","test":"jest","postbuild":"NODE_ENV=PRODUCTION jest","pretest":"gcc ./test/fuzzing/parse.c -o ./test/fuzzing/parse.out -lm -Wall"},"keywords":["webassembly","floating-point"],"author":{"name":"Mauro Bringolf"},"license":"ISC","dependencies":{},"devDependencies":{"babel-cli":"^6.26.0","babel-preset-env":"^1.6.1","babel-preset-minify":"^0.2.0","jest":"^22.0.4"},"gitHead":"acadba1ac9921152f0f819ed78a257090645e5cb","_id":"webassembly-floating-point-hex-parser@0.1.2","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"maurobringolf","email":"mauro@bringolf.com"},"dist":{"integrity":"sha512-TUf1H++8U10+stJbFydnvrpG5Sznz5Rilez/oZlV5zI0C/e4cSxd8rALAJ8VpTvjVWxLmL3SVSJUK6Ap9AoiNg==","shasum":"85bb01f54e68690c2645ea0cfad26c1110fdf988","tarball":"https://registry.npmjs.org/webassembly-floating-point-hex-parser/-/webassembly-floating-point-hex-parser-0.1.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAQZFnlBLGgdZHoibjT+Xr2aii0g17wpYrkpukNy17pSAiEAntnMEsHntvjmIPy6VQCaKOx53jxDN89uQvRuIARY0WI="}]},"maintainers":[{"name":"maurobringolf","email":"mauro@bringolf.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webassembly-floating-point-hex-parser-0.1.2.tgz_1514737598652_0.9213068727403879"}},"0.1.3":{"name":"webassembly-floating-point-hex-parser","bugs":{"url":"https://github.com/maurobringolf/webassembly-floating-point-hex-parser/issues"},"contributors":[{"name":"maurobringolf"}],"engines":{"node":"*"},"repository":{"type":"git","url":"git+https://github.com/maurobringolf/webassembly-floating-point-hex-parser.git"},"homepage":"https://github.com/maurobringolf/webassembly-floating-point-hex-parser","version":"0.1.3","description":"A function to parse floating point hexadecimal strings as defined by the WebAssembly specification","main":"lib/index.js","scripts":{"build":"babel src -d lib","prepublishOnly":"npm run build","watch":"jest --watch *.js","test":"jest","postbuild":"NODE_ENV=PRODUCTION jest","pretest":"gcc ./test/fuzzing/parse.c -o ./test/fuzzing/parse.out -lm -Wall"},"keywords":["webassembly","floating-point"],"author":{"name":"Mauro Bringolf"},"license":"MIT","dependencies":{},"devDependencies":{"babel-cli":"^6.26.0","babel-preset-env":"^1.6.1","babel-preset-minify":"^0.2.0","jest":"^22.0.4"},"gitHead":"ef9a08b0657d8f00aa23aeae181a1733df43a43c","_id":"webassembly-floating-point-hex-parser@0.1.3","_npmVersion":"5.6.0","_nodeVersion":"8.9.1","_npmUser":{"name":"maurobringolf","email":"mauro@bringolf.com"},"dist":{"integrity":"sha512-9EH7fXKn3gLii5bXNWjB0eJPlf+K8R53lxjaA/qCAm7nqJQWZfSQ6qWkfisa7Jmed/7j1MPCQsMCzbZrifGtlg==","shasum":"e68443bac8d4a216e5dfbf5858c90c834a7bec3f","tarball":"https://registry.npmjs.org/webassembly-floating-point-hex-parser/-/webassembly-floating-point-hex-parser-0.1.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC3zznt2uB/BUPsmfo/c1xub19e/chhkrSaD64p5ILnIwIgWnKEhEnnpyR/ujf2iqCQvhzyZVBUP13vEVYDiP6tGQ0="}]},"maintainers":[{"name":"maurobringolf","email":"mauro@bringolf.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webassembly-floating-point-hex-parser-0.1.3.tgz_1515323439610_0.05415981193073094"}}},"readme":"# Parser function for floating point hexadecimals\n\n[![CircleCI](https://img.shields.io/circleci/project/github/maurobringolf/webassembly-floating-point-hex-parser/master.svg)]()\n[![Github file size](https://img.shields.io/github/size/maurobringolf/webassembly-floating-point-hex-parser/lib/index.js.svg)]()\n[![license](https://img.shields.io/github/license/maurobringolf/webassembly-floating-point-hex-parser.svg)]()\n[![GitHub last commit](https://img.shields.io/github/last-commit/maurobringolf/webassembly-floating-point-hex-parser.svg)]()\n[![npm](https://img.shields.io/npm/v/webassembly-floating-point-hex-parser.svg)]()\n\nA 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 'webassembly-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/webassembly-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/webassembly-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","maintainers":[{"name":"maurobringolf","email":"mauro@bringolf.com"}],"time":{"modified":"2022-05-24T05:22:12.576Z","created":"2017-12-30T20:19:29.417Z","0.1.0":"2017-12-30T20:19:29.417Z","0.1.1":"2017-12-31T11:49:34.520Z","0.1.2":"2017-12-31T16:26:38.752Z","0.1.3":"2018-01-07T11:10:39.693Z"},"homepage":"https://github.com/maurobringolf/webassembly-floating-point-hex-parser","keywords":["webassembly","floating-point"],"repository":{"type":"git","url":"git+https://github.com/maurobringolf/webassembly-floating-point-hex-parser.git"},"contributors":[{"name":"maurobringolf"}],"author":{"name":"Mauro Bringolf"},"bugs":{"url":"https://github.com/maurobringolf/webassembly-floating-point-hex-parser/issues"},"license":"MIT","readmeFilename":"README.md"}