{"versions":{"0.0.0":{"name":"farmhash-modern","version":"0.0.0","description":"FarmHash functions compiled using Rust and WebAssembly to make them easy to use in node.js and the browser","keywords":["bigquery","farm_fingerprint","farmhash","fingerprint","hash","rust","wasm","webassembly"],"main":"lib/index.cjs","module":"lib/index.mjs","types":"lib/index.d.ts","exports":{"browser":"./lib/browser.js","import":"./lib/index.mjs","default":"./lib/index.cjs"},"repository":{"type":"git","url":"git+ssh://git@github.com/ForbesLindesay/npm-package-template.git"},"author":{"name":"Forbes Lindesay","email":"forbes@lindesay.co.uk"},"license":"MIT","scripts":{"build":"yarn build:rust && yarn build:tsc","build:rust":"yarn build:rust:bundler && yarn build:rust:nodejs","build:rust:web":"wasm-pack build rust-src --target web --out-dir ../bin/web","build:rust:bundler":"wasm-pack build rust-src --target bundler --out-dir ../bin/bundler","build:rust:nodejs":"wasm-pack build rust-src --target nodejs --out-dir ../bin/nodejs","build:tsc":"tsc","postbuild":"rimraf lib/**/__tests__ && node post-build-script && rimraf web-app/node_modules/farmhash-modern && rimraf tests/node_modules/farmhash-modern && npm pack","lint":"eslint --config .eslintrc-ts.js --no-eslintrc --ext .ts,.tsx src","lint:fix":"eslint --fix --config .eslintrc-ts.js --no-eslintrc --ext .ts,.tsx src","prettier:write":"prettier --ignore-path .gitignore --write './**/*.{md,json,yaml,js,jsx,ts,tsx}'","prettier:check":"prettier --ignore-path .gitignore --list-different './**/*.{md,json,yaml,js,jsx,ts,tsx}'","pretest":"rimraf tests/package-lock.json && cd tests && npm install","test":"yarn test:cjs && yarn test:mjs && yarn test:typescript && yarn test:attw","test:cjs":"node tests/src/test.cjs","test:mjs":"node tests/src/test.mjs","test:typescript":"cd tests && tsc","test:attw":"yarn attw farmhash-modern-0.0.0.tgz"},"dependencies":{},"devDependencies":{"@arethetypeswrong/cli":"^0.4.2","@forbeslindesay/tsconfig":"^2.1.0","@types/node":"^20.3.2","@typescript-eslint/eslint-plugin":"^5.60.1","@typescript-eslint/parser":"^5.60.1","eslint-plugin-import":"^2.27.5","eslint":"^8.43.0","husky":"^4.2.5","lint-staged":"^10.1.3","prettier":"^2.8.8","rimraf":"^3.0.2","typescript":"^5.1.6"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{md,json,yaml,js,jsx,ts,tsx}":["prettier --write","git add"]},"engines":{"node":">=18.0.0"},"gitHead":"9345e7bc5b76147424f7b245c3c9b86a43000310","bugs":{"url":"https://github.com/ForbesLindesay/npm-package-template/issues"},"homepage":"https://github.com/ForbesLindesay/npm-package-template#readme","_id":"farmhash-modern@0.0.0","_nodeVersion":"18.16.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-qvQbyPdr66TuEfWw8R6qdAlqYwDMdvvAtNeNHYXWCjAO+7ysRPrTw/adNlqKPtSgfDQu+Fk8yI4Qsh5mLUF+3g==","shasum":"be62169243fb8a33447c05933fc2d5308cf16772","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/farmhash-modern/-/farmhash-modern-0.0.0.tgz","fileCount":17,"unpackedSize":104450,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4t6nVcsR4lu0DlOM8Lh0gHAI8G9cJ/gakt4DyegyplwIgDbyJmJMey963RicugztMswgw4b6SADu5+wgbzWk/65A="}],"size":24854},"_npmUser":{"name":"anonymous","email":"forbes@lindesay.co.uk"},"directories":{},"maintainers":[{"name":"anonymous","email":"forbes@lindesay.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/farmhash-modern_0.0.0_1688045992043_0.8919283232616511"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-06-29T13:39:52.286Z","publish_time":1688045992286,"_source_registry_name":"default","contributors":[]},"1.0.0":{"name":"farmhash-modern","version":"1.0.0","description":"FarmHash functions compiled using Rust and WebAssembly to make them easy to use in node.js and the browser","keywords":["bigquery","farm_fingerprint","farmhash","fingerprint","hash","rust","wasm","webassembly"],"main":"lib/index.cjs","module":"lib/index.mjs","types":"lib/index.d.ts","exports":{"browser":"./lib/browser.js","import":"./lib/index.mjs","default":"./lib/index.cjs"},"repository":{"type":"git","url":"git+ssh://git@github.com/ForbesLindesay/npm-package-template.git"},"author":{"name":"Forbes Lindesay","email":"forbes@lindesay.co.uk"},"license":"MIT","scripts":{"build":"yarn build:rust && yarn build:tsc","build:rust":"yarn build:rust:bundler && yarn build:rust:nodejs","build:rust:web":"wasm-pack build rust-src --target web --out-dir ../bin/web","build:rust:bundler":"wasm-pack build rust-src --target bundler --out-dir ../bin/bundler","build:rust:nodejs":"wasm-pack build rust-src --target nodejs --out-dir ../bin/nodejs","build:tsc":"tsc","postbuild":"rimraf lib/**/__tests__ && node post-build-script && rimraf web-app/node_modules/farmhash-modern && rimraf tests/node_modules/farmhash-modern && npm pack","lint":"eslint --config .eslintrc-ts.js --no-eslintrc --ext .ts,.tsx src","lint:fix":"eslint --fix --config .eslintrc-ts.js --no-eslintrc --ext .ts,.tsx src","prettier:write":"prettier --ignore-path .gitignore --write './**/*.{md,json,yaml,js,jsx,ts,tsx}'","prettier:check":"prettier --ignore-path .gitignore --list-different './**/*.{md,json,yaml,js,jsx,ts,tsx}'","pretest":"rimraf tests/package-lock.json && cd tests && npm install","test":"yarn test:cjs && yarn test:mjs && yarn test:typescript && yarn test:attw","test:cjs":"node tests/src/test.cjs","test:mjs":"node tests/src/test.mjs","test:typescript":"cd tests && tsc","test:attw":"yarn attw farmhash-modern-0.0.0.tgz"},"dependencies":{},"devDependencies":{"@arethetypeswrong/cli":"^0.4.2","@forbeslindesay/tsconfig":"^2.1.0","@types/node":"^20.3.2","@typescript-eslint/eslint-plugin":"^5.60.1","@typescript-eslint/parser":"^5.60.1","eslint-plugin-import":"^2.27.5","eslint":"^8.43.0","husky":"^4.2.5","lint-staged":"^10.1.3","prettier":"^2.8.8","rimraf":"^3.0.2","typescript":"^5.1.6"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{md,json,yaml,js,jsx,ts,tsx}":["prettier --write","git add"]},"engines":{"node":">=18.0.0"},"gitHead":"5e61100527c0bd69c637f08c42e6d47ad1a1b8d2","bugs":{"url":"https://github.com/ForbesLindesay/npm-package-template/issues"},"homepage":"https://github.com/ForbesLindesay/npm-package-template#readme","_id":"farmhash-modern@1.0.0","_nodeVersion":"18.16.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-MRSYtl1syHtFswYxyGN8KlHiGnn6Q9EJmK2JcteVc3LcnMRm6Ad4YJiyjqNEd5mbpJQ49FHYPXMpF4KVYoR8uw==","shasum":"5b95bc3b64490161c0fa51699971a0cb179d3d2f","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/farmhash-modern/-/farmhash-modern-1.0.0.tgz","fileCount":17,"unpackedSize":116757,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB1isFedN7UGDuImo6Ln9dCdS6knqjCjcWypIblMdf74AiBlW+ubwLVxWk47IQ/npRwYdD+0PT7YN6Xt4L36YdDpvA=="}],"size":27410},"_npmUser":{"name":"anonymous","email":"forbes@lindesay.co.uk"},"directories":{},"maintainers":[{"name":"anonymous","email":"forbes@lindesay.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/farmhash-modern_1.0.0_1688047991434_0.16812831351478463"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-06-29T14:13:11.645Z","publish_time":1688047991645,"_source_registry_name":"default","contributors":[]},"1.1.0":{"name":"farmhash-modern","version":"1.1.0","description":"FarmHash functions compiled using Rust and WebAssembly to make them easy to use in node.js and the browser","keywords":["bigquery","farm_fingerprint","farmhash","fingerprint","hash","rust","wasm","webassembly"],"main":"lib/index.cjs","module":"lib/index.mjs","types":"lib/index.d.ts","exports":{"browser":"./lib/browser.js","import":"./lib/index.mjs","default":"./lib/index.cjs"},"repository":{"type":"git","url":"git+ssh://git@github.com/ForbesLindesay/npm-package-template.git"},"author":{"name":"Forbes Lindesay","email":"forbes@lindesay.co.uk"},"license":"MIT","scripts":{"build":"yarn build:rust && yarn build:tsc","build:rust":"yarn build:rust:bundler && yarn build:rust:nodejs","build:rust:web":"wasm-pack build rust-src --target web --out-dir ../bin/web","build:rust:bundler":"wasm-pack build rust-src --target bundler --out-dir ../bin/bundler","build:rust:nodejs":"wasm-pack build rust-src --target nodejs --out-dir ../bin/nodejs","build:tsc":"tsc","postbuild":"rimraf lib/**/__tests__ && node post-build-script && rimraf web-app/node_modules/farmhash-modern && rimraf tests/node_modules/farmhash-modern && npm pack","lint":"eslint --config .eslintrc-ts.js --no-eslintrc --ext .ts,.tsx src","lint:fix":"eslint --fix --config .eslintrc-ts.js --no-eslintrc --ext .ts,.tsx src","prettier:write":"prettier --ignore-path .gitignore --write './**/*.{md,json,yaml,js,jsx,ts,tsx}'","prettier:check":"prettier --ignore-path .gitignore --list-different './**/*.{md,json,yaml,js,jsx,ts,tsx}'","pretest":"rimraf tests/package-lock.json && cd tests && npm install","test":"yarn test:cjs && yarn test:mjs && yarn test:typescript && yarn test:attw","test:cjs":"node tests/src/test.cjs","test:mjs":"node tests/src/test.mjs","test:typescript":"cd tests && tsc","test:attw":"yarn attw farmhash-modern-0.0.0.tgz"},"dependencies":{},"devDependencies":{"@arethetypeswrong/cli":"^0.4.2","@forbeslindesay/tsconfig":"^2.1.0","@types/node":"^20.3.2","@typescript-eslint/eslint-plugin":"^5.60.1","@typescript-eslint/parser":"^5.60.1","eslint-plugin-import":"^2.27.5","eslint":"^8.43.0","husky":"^4.2.5","lint-staged":"^10.1.3","prettier":"^2.8.8","rimraf":"^3.0.2","typescript":"^5.1.6"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{md,json,yaml,js,jsx,ts,tsx}":["prettier --write","git add"]},"engines":{"node":">=18.0.0"},"gitHead":"d544992cf8e681961063ceeb207a42a98cd1ca35","bugs":{"url":"https://github.com/ForbesLindesay/npm-package-template/issues"},"homepage":"https://github.com/ForbesLindesay/npm-package-template#readme","_id":"farmhash-modern@1.1.0","_nodeVersion":"18.16.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-6ypT4XfgqJk/F3Yuv4SX26I3doUjt0GTG4a+JgWxXQpxXzTBq8fPUeGHfcYMMDPHJHm3yPOSjaeBwBGAHWXCdA==","shasum":"c36b34ad196290d57b0b482dc89e637d0b59835f","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/farmhash-modern/-/farmhash-modern-1.1.0.tgz","fileCount":17,"unpackedSize":116757,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3wnGpzEiEGXJuI6agV483J2EeHbFbyMQ+6/EUI74u0gIhAO/W0Jufzmy3NRkyfxUuE3LSQZBuw86JoKkrdY4+SnUI"}],"size":27407},"_npmUser":{"name":"anonymous","email":"forbes@lindesay.co.uk"},"directories":{},"maintainers":[{"name":"anonymous","email":"forbes@lindesay.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/farmhash-modern_1.1.0_1688051024368_0.651868468447725"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-06-29T15:03:44.546Z","publish_time":1688051024546,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"1.1.0"},"name":"farmhash-modern","time":{"created":"2023-06-29T21:05:58.649Z","modified":"2023-06-29T21:06:00.164Z","0.0.0":"2023-06-29T13:39:52.286Z","1.0.0":"2023-06-29T14:13:11.645Z","1.1.0":"2023-06-29T15:03:44.546Z"},"readme":"# farmhash-modern\n\nWASM/Web-Assembly implementation of Google's FarmHash family of very fast hash functions for use in node.js and the browser. FarmHash is the successor to CityHash. Functions in the FarmHash family are not suitable for cryptography.\n\nThe [existing farmhash npm packge](https://github.com/lovell/farmhash) works great if you can get it to build, but this can create a lot of pain. This WASM build should work on any operating system that uses node.js with zero extra configuration. It should be 100% consistent across different platforms. You can even use it in the browser. This package also includes TypeScript types, and a handy `bigqueryFingerprint` that matches BigQuery's `FARM_FINGERPRINT` function.\n\nThis WASM implementation is built using the [farmhash Rust Crate](https://crates.io/crates/farmhash). The 64-bit APIs use JavaScript's BigInt type to represent results. If you need a base-10 string, you can simply call `.toString()` on the result.\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/ForbesLindesay/farmhash-modern/test.yml?event=push&style=for-the-badge)](https://github.com/ForbesLindesay/farmhash-modern/actions?query=workflow%3ATest+branch%3Amain)\n[![Rolling Versions](https://img.shields.io/badge/Rolling%20Versions-Enabled-brightgreen?style=for-the-badge)](https://rollingversions.com/ForbesLindesay/farmhash-modern)\n[![NPM version](https://img.shields.io/npm/v/farmhash-modern?style=for-the-badge)](https://www.npmjs.com/package/farmhash-modern)\n\n[Click here for a live demo](https://farmhash.forbeslindesay.co.uk)\n\n## Node.js\n\n### Installation\n\nInstall using npm or yarn.\n\n```sh\nnpm install farmhash-modern\n# or\nyarn install farmhash-modern\n```\n\n### Usage\n\nImport using ES Module syntax or CommonJS syntax.\n\n```typescript\nimport * as farmhash from 'farmhash-modern';\n\nconsole.log(farmhash.fingerprint32('hello world'));\n```\n\nor\n\n```javascript\nconst farmhash = require('farmhash-modern');\n\nconsole.log(farmhash.fingerprint32('hello world'));\n```\n\n## Webpack\n\n### Installation\n\n```sh\nnpm install farmhash-modern\n# or\nyarn install farmhash-modern\n```\n\nIn your `webpack.config.js` file, make sure you have set:\n\n```js\nmodule.exports = {\n  // ...\n  experiments: {asyncWebAssembly: true},\n  // ...\n};\n```\n\nAlso, make sure you do not have any rules that will capture `.wasm` files and turn them into URLs or some other format.\n\n### Usage\n\nImport using ES Module syntax syntax.\n\n```typescript\nimport * as farmhash from 'farmhash-modern';\n\nconsole.log(farmhash.fingerprint32('hello world'));\n```\n\n## API\n\n### `fingerprint32(input: string | Uint8Array): number`\n\nCreate a new farmhash based u32 for a string or an array of bytes. Fingerprint value should be portable and stable across library versions and platforms.\n\n### `fingerprint64(input: string | Uint8Array): bigint`\n\nCreate a new farmhash based u64 for a string or an array of bytes. Fingerprint value should be portable and stable across library versions and platforms.\n\n### `bigqueryFingerprint(input: string | Uint8Array): bigint`\n\nCreate a new farmhash based i64 for a string or an array of bytes. Fingerprint value should be portable and stable across library versions and platforms.\n\nThis matches the format used by BigQuery's FARM_FINGERPRINT function.\n\n### `hash32(input: string | Uint8Array): number`\n\nCreate a new farmhash based u32 for an array of bytes. Hash value may vary with library version.\n\n### `hash32WithSeed(input: string | Uint8Array, seed: number): number\n\nCreate a new farmhash based u32 for an array of bytes with a given seed. Hash value may vary with library version.\n\n### `hash64(input: string | Uint8Array): bigint`\n\nCreate a new farmhash based u64 for an array of bytes. Hash value may vary with library version.\n\n### `hash64WithSeed(input: string | Uint8Array, seed: bigint): bigint\n\nCreate a new farmhash based u64 for an array of bytes with a given seed. Hash value may vary with library version.\n\n## Building the web-app example\n\n1. Install dependencies for farmhash-modern: `yarn install`\n2. Build farmhash-modern: `yarn build`\n3. Install dependencies for web-app: `cd web-app && npm install`\n4. Build the web-app: `cd web-app && npm build`\n\n## License\n\nMIT","users":{}}