{"_id":"highwayhash-wasm","_rev":"4-ef85b61044f43bc0d32a18cdcf65445b","name":"highwayhash-wasm","dist-tags":{"latest":"1.2.7"},"versions":{"1.2.5":{"name":"highwayhash-wasm","version":"1.2.5","keywords":["highwayhash","highwayhash-wasm","highway","highway-wasm","hash","wasm","crypto"],"author":{"name":"Andreas Sonnleitner","email":"asonnleitner@gmail.com"},"license":"MIT","_id":"highwayhash-wasm@1.2.5","maintainers":[{"name":"asonnleitner","email":"andreas@etherealcap.com"}],"homepage":"https://github.com/asonnleitner/highwayhash-wasm#readme","bugs":{"url":"https://github.com/asonnleitner/highwayhash-wasm/issues"},"dist":{"shasum":"fa316f02d432973c36f563743bb07cc39b63c35d","tarball":"https://registry.npmjs.org/highwayhash-wasm/-/highwayhash-wasm-1.2.5.tgz","fileCount":6,"integrity":"sha512-WmPTu0kwrxkI7txMzaoG8w5PBXtFYkWHh382wjjVMVDl5n+ABsvnOXk0TVWRbpneQ5LBwGl+/p1ObTBUUzo2qw==","signatures":[{"sig":"MEQCIF+2bIqVYCvi0WdG48BNDaxmHvt1D8slvQKcN6Q6AcP1AiBYgyQTORWm/K8VTpFRYM3tlM76mU0TMYWDRvLx/Yzepg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":216377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiHoTFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoeQA/5AV8RaStMhfXWV3IAbMY8wq43lny6EXi7abI5eAQt+HqYiXb1\r\ngSy4b73DbRPLma5In2Qgp8ev4okVb1I7pGfKlZnYNIqHRxoMjkntgBsGTB5n\r\n64JpMfXAskzpczJOLwi58tXjcJsYLPRTomLvwlXbNZqp4lZArWuRMmQWQ+Sb\r\ne7Lx9eXoCFNZMCxTuStT6mY/Dosn+8+jjRi1qT/XRKo2k9NMlEHh6xiAQ8aK\r\n+T7zYEM13JbILHNFARoxB+Fky0mYLHotgyE0Sz7ncWnelzrN7Qhwc9o8x6PB\r\nguW6QwsIUpL7OGbMoTjDN/zfQ/HSCLbwnmHTbugmPR7hcgB349FTXNx7705L\r\nEcqmWtUd6JqWEng+WgJVUhOAwP0hYfPykuEnjLsWEZXsEw6WD4ZAeZ1wmDAF\r\n3snDWw2gKoCz5o2N9bBBlW1o5m4zCGES3XaabyCn5im4rdUZVtcXng4bPHvW\r\nMfcww3BTmtVBuducTEkPBZhmh+im5wPYbodJm4bQKyb/gPWhER7VvCD1naN+\r\nOll8W2Cv9IbMuMFUkKKTU0U1TfEg3t7k3oLEnIhYStZUeMCQLKcUy0sXDMEn\r\ns+ES+pM60Q5FAnbdoIBeISbFBiv/aDElTc9mCIiFpuy1evRzNddCtEZ/ZBTz\r\no1yK2lRli08tkG+DVwlTs7x3ze2xT1xdB6c=\r\n=VuPC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/highwayhash-wasm.cjs.js","pnpm":{"version":">=6.32.1"},"types":"dist/highwayhash-wasm.d.ts","unpkg":"dist/highwayhash-wasm.global.js","module":"dist/highwayhash-wasm.esm.js","engines":{"node":">=16.14.0"},"gitHead":"1bade514967298d4b4a6979d9bd99d5d043c1552","scripts":{"dev":"ts-node scripts/dev.ts","lint":"pnpm lint:js && pnpm lint:prettier","build":"pnpm clean && pnpm optimized-build:wasm && pnpm build:js && pnpm make-types","clean":"rm -rf dist/* && rm -rf js/highwayhash-wasm/lib/*","lint:js":"eslint --ext .ts js/**/*.ts","prepare":"husky install","build:js":"pnpm build:esm && pnpm build:cjs && pnpm build:global","dev:vite":"vite","build:cjs":"ts-node scripts/build.ts highwayhash-wasm -f cjs","build:esm":"ts-node scripts/build.ts highwayhash-wasm -f esm","make-types":"api-extractor run --local --verbose","build:global":"ts-node scripts/build.ts highwayhash-wasm -f global","lint:prettier":"prettier --write --parser typescript \"js/**/*.ts\"","optimized-build:wasm":"scripts/build && scripts/optimize"},"_npmUser":{"name":"asonnleitner","email":"andreas@etherealcap.com"},"jsdelivr":"dist/highwayhash-wasm.global.js","repository":{"url":"git://github.com/asonnleitner/highwayhash-wasm.git","type":"git"},"_npmVersion":"8.3.1","description":"HighwayHash WASM bindings for browser and node environments","directories":{},"lint-staged":{"*.js":"prettier --write","*.ts":"prettier --write --parser typescript"},"_nodeVersion":"16.14.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","vite":"^2.8.4","husky":"^7.0.4","tslib":"^2.3.1","eslint":"^8.9.0","esbuild":"^0.14.23","nodemon":"^2.0.15","ts-jest":"^27.1.3","ts-node":"^10.5.0","minimist":"^1.2.5","prettier":"^2.5.1","wasm-opt":"^1.3.0","puppeteer":"^13.4.0","babel-jest":"^27.5.1","typescript":"^4.5.5","@babel/core":"^7.17.5","@jest/types":"^27.5.1","@types/jest":"^27.4.1","@types/node":"^17.0.21","lint-staged":"^12.3.4","magic-string":"^0.25.7","@commitlint/cli":"^16.2.1","semantic-release":"^19.0.2","@babel/preset-env":"^7.16.11","@semantic-release/git":"^10.0.1","@semantic-release/npm":"^9.0.1","@microsoft/api-extractor":"^7.19.4","esbuild-plugin-wasm-pack":"^1.1.0","@typescript-eslint/parser":"^5.12.1","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^16.2.1","@typescript-eslint/eslint-plugin":"^5.12.1"},"_npmOperationalInternal":{"tmp":"tmp/highwayhash-wasm_1.2.5_1646167237518_0.9750390402461777","host":"s3://npm-registry-packages"}},"1.2.6":{"name":"highwayhash-wasm","version":"1.2.6","keywords":["highwayhash","highwayhash-wasm","highway","highway-wasm","hash","wasm","crypto"],"author":{"name":"Andreas Sonnleitner","email":"asonnleitner@gmail.com"},"license":"MIT","_id":"highwayhash-wasm@1.2.6","maintainers":[{"name":"asonnleitner","email":"andreas@etherealcap.com"}],"homepage":"https://github.com/asonnleitner/highwayhash-wasm#readme","bugs":{"url":"https://github.com/asonnleitner/highwayhash-wasm/issues"},"dist":{"shasum":"8a02f89d00ec8b74fb7e9c671fa12cf95deddaef","tarball":"https://registry.npmjs.org/highwayhash-wasm/-/highwayhash-wasm-1.2.6.tgz","fileCount":6,"integrity":"sha512-Aqjjc0NOMBXAs565xTOwLXg3U89r2GXRHikqB/UmhE7wypc4rWPLuhMI9avtqIpTr4gMlHJJEYjFkgRedPDvyA==","signatures":[{"sig":"MEQCIAy+Mqto6OWb2CisEwgaCJeCBidyue7WKu/4DIM76Al2AiAy6GlVk4j7zTNlOlq8anAunzYxJg+RRX7beJDjLM/QAg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":216377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiHoZaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpIgxAAgZauq+/ro0QaiQOBD26wwtc6wQHKasLNu//Hu2jsIEmnE8cV\r\nxpxtq6GQyNPljDClxMAntl80JAjUW2HBToRkmtDJA1ln4xK5DJTDP1OtRMI6\r\nwaAeL+IrWUzNxTBKUV0HWJqCUsSxb8jhA5+r9Vs006SFYj1QsD0brgm7Fbvt\r\nbd0oxQM5Lr9mg7V1aQzTZMacfZjljXTgy19KQ89cJkrH/Fj+7HlPVTIjWFcX\r\nEzRz5UEJqOM1wfFjc+Al7deQIcV8BOlEF4eBQ0aAgm017YKvKjrNOAoQcfkM\r\nU+ZxtqLE+kx3i0yrHc7TGt/jl3PSnEleGBz9nwFrBUGIFaWHOSCsvIpngEFi\r\nGkqLDevgPIy+Ioo/AZWXe5syFrdnWFYVBx0a01e+l9CAYPb9SwXkC8gRnjpb\r\nArnfB/K5aXSrXJTyofEi9Wjo2DHmJ7A02I7NS53bKJp6NQGPL6HO7khb0REJ\r\n1vqARCfw3/6GBEAR6xTpLTMQ4CX5ReljdOmHMj3zcJ1SgAS7ewriq3BtCqiQ\r\ne1OXeKAi/WHo99kOsNeAlTcrd/sSqoZ6XXWIKcTUC0q9pZCgBZ/B0jJ0jYsT\r\nCHdDdTPbCRLpAJBgX4WQEKIVMpvRrjEhwVEQYJImAzRFt0qniYiIfMeoRAo1\r\nrCOG+LwICDAN0dc3OHpPhCywBGqwZxIkMiM=\r\n=gMw3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/highwayhash-wasm.cjs.js","pnpm":{"version":">=6.32.1"},"types":"dist/highwayhash-wasm.d.ts","unpkg":"dist/highwayhash-wasm.global.js","module":"dist/highwayhash-wasm.esm.js","engines":{"node":">=16.14.0"},"gitHead":"ab82cbe1fc88c202f0dc3817c7f5802dfd8e891d","scripts":{"dev":"ts-node scripts/dev.ts","lint":"pnpm lint:js && pnpm lint:prettier","build":"pnpm clean && pnpm optimized-build:wasm && pnpm build:js && pnpm make-types","clean":"rm -rf dist/* && rm -rf js/highwayhash-wasm/lib/*","lint:js":"eslint --ext .ts js/**/*.ts","prepare":"husky install","build:js":"pnpm build:esm && pnpm build:cjs && pnpm build:global","dev:vite":"vite","build:cjs":"ts-node scripts/build.ts highwayhash-wasm -f cjs","build:esm":"ts-node scripts/build.ts highwayhash-wasm -f esm","make-types":"api-extractor run --local --verbose","build:global":"ts-node scripts/build.ts highwayhash-wasm -f global","lint:prettier":"prettier --write --parser typescript \"js/**/*.ts\"","optimized-build:wasm":"scripts/build && scripts/optimize"},"_npmUser":{"name":"asonnleitner","email":"andreas@etherealcap.com"},"jsdelivr":"dist/highwayhash-wasm.global.js","repository":{"url":"git://github.com/asonnleitner/highwayhash-wasm.git","type":"git"},"_npmVersion":"8.3.1","description":"HighwayHash WASM bindings for browser and node environments","directories":{},"lint-staged":{"*.js":"prettier --write","*.ts":"prettier --write --parser typescript"},"_nodeVersion":"16.14.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","vite":"^2.8.4","husky":"^7.0.4","tslib":"^2.3.1","eslint":"^8.9.0","esbuild":"^0.14.23","nodemon":"^2.0.15","ts-jest":"^27.1.3","ts-node":"^10.5.0","minimist":"^1.2.5","prettier":"^2.5.1","wasm-opt":"^1.3.0","puppeteer":"^13.4.0","babel-jest":"^27.5.1","typescript":"^4.5.5","@babel/core":"^7.17.5","@jest/types":"^27.5.1","@types/jest":"^27.4.1","@types/node":"^17.0.21","lint-staged":"^12.3.4","magic-string":"^0.25.7","@commitlint/cli":"^16.2.1","semantic-release":"^19.0.2","@babel/preset-env":"^7.16.11","@semantic-release/git":"^10.0.1","@semantic-release/npm":"^9.0.1","@microsoft/api-extractor":"^7.19.4","esbuild-plugin-wasm-pack":"^1.1.0","@typescript-eslint/parser":"^5.12.1","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^16.2.1","@typescript-eslint/eslint-plugin":"^5.12.1"},"_npmOperationalInternal":{"tmp":"tmp/highwayhash-wasm_1.2.6_1646167642331_0.7675360573710761","host":"s3://npm-registry-packages"}},"1.2.7":{"name":"highwayhash-wasm","version":"1.2.7","packageManager":"pnpm@10.6.2","description":"HighwayHash WASM bindings for browser and node environments","author":{"name":"Andreas Sonnleitner","email":"asonnleitner@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git://github.com/asonnleitner/highwayhash-wasm.git"},"keywords":["highwayhash","highwayhash-wasm","highway","highway-wasm","hash","wasm","crypto"],"main":"dist/highwayhash-wasm.cjs.js","module":"dist/highwayhash-wasm.esm.js","unpkg":"dist/highwayhash-wasm.global.js","jsdelivr":"dist/highwayhash-wasm.global.js","types":"dist/highwayhash-wasm.d.ts","engines":{"node":">=22","npm":">=10"},"scripts":{"dev":"ts-node scripts/dev.ts","dev:vite":"vite","lint":"eslint","lint:fix":"eslint --fix","build":"pnpm clean && pnpm optimized-build:wasm && pnpm build:js && pnpm make-types","make-types":"api-extractor run --local --verbose","build:js":"pnpm build:esm && pnpm build:cjs && pnpm build:global","build:esm":"ts-node scripts/build.ts highwayhash-wasm -f esm","build:cjs":"ts-node scripts/build.ts highwayhash-wasm -f cjs","build:global":"ts-node scripts/build.ts highwayhash-wasm -f global","optimized-build:wasm":"scripts/build && scripts/optimize","clean":"rm -rf dist/* || true && rm -rf js/highwayhash-wasm/lib/* || true","prepare":"simple-git-hooks"},"devDependencies":{"@antfu/eslint-config":"catalog:","@commitlint/cli":"catalog:","@commitlint/config-conventional":"catalog:","@microsoft/api-extractor":"catalog:","@semantic-release/changelog":"catalog:","@semantic-release/git":"catalog:","@semantic-release/npm":"catalog:","@types/minimist":"catalog:","@types/node":"catalog:","@typescript-eslint/eslint-plugin":"catalog:","@typescript-eslint/parser":"catalog:","esbuild":"catalog:","esbuild-plugin-wasm-pack":"catalog:","eslint":"catalog:","lint-staged":"catalog:","magic-string":"catalog:","minimist":"catalog:","semantic-release":"catalog:","simple-git-hooks":"catalog:","ts-node":"catalog:","typescript":"catalog:","vite":"catalog:","wasm-opt":"catalog:"},"simple-git-hooks":{"pre-commit":"pnpm lint-staged"},"lint-staged":{"*":"eslint --fix"},"_id":"highwayhash-wasm@1.2.7","gitHead":"315b74eeb77c07bfdacfe7ccb186ce7fb4d86594","bugs":{"url":"https://github.com/asonnleitner/highwayhash-wasm/issues"},"homepage":"https://github.com/asonnleitner/highwayhash-wasm#readme","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-yKmOGlpCbnlfqLZI9UdYIyyQKhJ2W0THVh5NpmObS9XITFG6V297XzctYgf4aFhZyoErMiZlbpIdMd4TJiNKbw==","shasum":"4c7180fd3ab2a1b133912b013f70bb05c94e0f18","tarball":"https://registry.npmjs.org/highwayhash-wasm/-/highwayhash-wasm-1.2.7.tgz","fileCount":6,"unpackedSize":235067,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDSKdgp+WegYKXIbAliaCrMPkXn8V07ZdPoAOonbHjVkgIhAJZ1i66s0qzD0zVkrtNfQafLKUCWYj/I4V9ngTdjHWz2"}]},"_npmUser":{"name":"asonnleitner","email":"andreassonnleitner@gmail.com"},"directories":{},"maintainers":[{"name":"asonnleitner","email":"andreassonnleitner@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/highwayhash-wasm_1.2.7_1742843104073_0.22442979696606824"},"_hasShrinkwrap":false}},"time":{"created":"2022-03-01T20:40:37.517Z","modified":"2025-03-24T19:05:04.516Z","1.2.5":"2022-03-01T20:40:37.643Z","1.2.6":"2022-03-01T20:47:22.496Z","1.2.7":"2025-03-24T19:05:04.326Z"},"bugs":{"url":"https://github.com/asonnleitner/highwayhash-wasm/issues"},"author":{"name":"Andreas Sonnleitner","email":"asonnleitner@gmail.com"},"license":"MIT","homepage":"https://github.com/asonnleitner/highwayhash-wasm#readme","keywords":["highwayhash","highwayhash-wasm","highway","highway-wasm","hash","wasm","crypto"],"repository":{"type":"git","url":"git://github.com/asonnleitner/highwayhash-wasm.git"},"description":"HighwayHash WASM bindings for browser and node environments","maintainers":[{"name":"asonnleitner","email":"andreassonnleitner@gmail.com"}],"readme":"![highwayhash-wasm](./docs/preview.png)\n\n# highwayhash-wasm\n\n[![npm version][npm-version-src]][npm-href]\n[![npm downloads][npm-downloads-src]][npm-href]\n[![Github Actions CI][github-actions-ci-src]][github-actions-ci-href]\n[![License][license-src]][npm-href]\n\n> JS bindings for browser and Node.js environment of the Rust implementation of HighwayHash, Google's fast, keyed, portable\n> (output is hardware independent) and secure hash function.\n\n## Features\n\n- Run on Node.js and browser with same API\n- Zero dependencies\n- Prebuilt and optimized WASM binary\n- Generate hashes at over 2GB/s when running on SIMD enabled WebAssembly\n- Generate 64, 128 and 256 bit hashes\n- Output hash as string, hexadecimal string\n- Hash data in chunks\n\n## Install\n\nAdd `highwayhash-wasm` dependency to your project:\n\n```shell\n# using npm\nnpm i highwayhash-wasm\n\n# using yarn\nyarn add highwayhash-wasm\n\n# using pnpm\npnpm add highwayhash-wasm\n```\n\n## Usage\n\nUse this method to generate hashes is the length of the data is not known in advance:\n\n```javascript\n// import the library using esm or cjs syntax\nimport { useHighwayHash } from 'highwayhash-wasm'\nconst { useHighwayHash } = require('highwayhash-wasm')\n\n// Some 32 byte key\nconst key = new Uint8Array(32).fill(8)\n// Some data to hash\nconst data = Uint8Array.from([0])\n\n// Load the wasm module which returns the the Highway object\nconst highway = await useHighwayHash({\n  // Optional: pass a key and keep it hidden from attackers to ensure\n  // unpredictability, and attackers can't mount a DoS attack\n  key,\n  // Optional: use SIMD for faster encryption, enabled by default\n  simd: true\n})\n\n// 1. method - encrypt data with Highway and return the hash\nconst h1 = highway.hash64(data).toString()\nconsole.log(h1) // 4652207699671410156\n\n// 2. method - if the data to hash is not known, create a hasher, and append\n// the data.\nconst hasher = highway.new(key)\nhasher.append(data)\n// After all data is appended, call the hash method to get the hash\n// do not call any additional methods on the hasher after finalizing\nconst h2 = hasher.finalize64().toString()\nconsole.log(h2) // 4652207699671410156\n\n// 3. method - hash the data with separate key and data\nconst h3 = highway.hasher.hash64(key, data).toString()\nconsole.log(h3) // 4652207699671410156\n```\n\n## API\n\n## `hasher`\n\nThe hasher initializes with SIMD if supported.\n\n## `hash`\n\nThe following methods are available to output hashes:\n\n### `toString`\n```javascript\n// returns the hash as a string\nconst hash = hasher.hash64(key, data).toString()\n// 4652207699671410156\n```\n### `toHex`\n```javascript\n// returns the hash as a hexadecimal string\nconst hash = hasher.hash64(key, data).toHex()\n// 408FF641204065EC\n```\n### `toBinary`\n```javascript\n// returns the hash as a binary string\nconst hash = hasher.hash64(key, data).toBinary()\n// 100000010001111111101100100000100100000010000000110010111101100\n```\n### `toOctal`\n```javascript\n// returns the hash as an octal string\nconst hash = hasher.hash64(key, data).toOctal()\n// 402177544044020062754\n```\n### `toBytes`\n```javascript\n// returns the hash as a Uint8Array\nconst hash = hasher.hash64(key, data).toBytes()\n// Uint8Array(8) [236, 101, 64, 32, 65, 246, 143, 64]\n```\n### `toUint32Array`\n```javascript\n// returns the hash as a Uint32Array\nconst hash = hasher.hash64(key, data).toUint32Array()\n// Uint32Array(1) [65]\n```\n### `toBigUint64Array`\n```javascript\n// returns the hash as a Uint64Array\nconst hash = hasher.hash64(key, data).toBigUint64Array()\n// BigUint64Array(1) [4652207699671410156n]\n```\n<!-- badges -->\n[npm-version-src]: https://badgen.net/npm/v/highwayhash-wasm\n[npm-href]: https://www.npmjs.com/package/highwayhash-wasm\n[npm-downloads-src]: https://badgen.net/npm/dm/highwayhash-wasm\n[github-actions-ci-src]: https://github.com/asonnleitner/highwayhash-wasm/actions/workflows/ci.yaml/badge.svg\n[github-actions-ci-href]: https://github.com/asonnleitner/highwayhash-wasm/actions/workflows/ci.yaml\n\n[license-src]: https://badgen.net/npm/license/highwayhash-wasm\n","readmeFilename":"README.md"}