### Install farmhashjs Source: https://github.com/crisp-oss/farmhash-js/blob/master/README.md Install the farmhashjs package using npm. ```bash npm install farmhashjs ``` -------------------------------- ### Import farmhashjs Aliases Source: https://github.com/crisp-oss/farmhash-js/blob/master/README.md Import and use the aliased hash functions, which map to the modern stable fingerprint functions. ```javascript import { hash64, hash32 } from 'farmhashjs'; // hash64 = fingerprint64 // hash32 = fingerprint32 ``` -------------------------------- ### Import and Use farmhashjs Functions Source: https://github.com/crisp-oss/farmhash-js/blob/master/README.md Import and use various hashing functions from the farmhashjs library. Recommended for modern applications are the stable fingerprint functions. Legacy functions are available for compatibility with farmhash v3.x. ```javascript import { fingerprint64, fingerprint32, legacyHash64_arm, legacyHash64_x86, legacyHash32_arm, legacyHash32_x86 } from 'farmhashjs'; // Modern stable fingerprints (recommended - same on all platforms) fingerprint64('hello world'); // "6381520714923946011" fingerprint32('hello world'); // 430397466 // Legacy hashes (compatible with farmhash@3.3.1) // Use _arm or _x86 suffix based on your target platform legacyHash64_arm('hello world'); // "16022978042064026561" legacyHash64_x86('hello world'); // "16022978042064026561" (same for <512 bytes) legacyHash32_arm('hello world'); // 3314386015 legacyHash32_x86('hello world'); // 1955099599 ``` -------------------------------- ### legacyHash64BigInt_arm Source: https://github.com/crisp-oss/farmhash-js/blob/master/README.md Computes a 64-bit hash compatible with farmhash v3.x on ARM64 architectures and returns it as a BigInt. ```APIDOC ## legacyHash64BigInt_arm(input) ### Description Computes a 64-bit hash compatible with farmhash@3.3.1 on ARM64 architectures and returns it as a BigInt. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript import { legacyHash64BigInt_arm } from 'farmhashjs'; legacyHash64BigInt_arm('hello world'); ``` ### Response #### Success Response (200) - **output** (bigint) - The 64-bit hash as a BigInt (ARM64 compatible). #### Response Example ```json { "output": 16022978042064026561n } ``` ``` -------------------------------- ### legacyHash64BigInt_x86 Source: https://github.com/crisp-oss/farmhash-js/blob/master/README.md Computes a 64-bit hash compatible with farmhash v3.x on x86_64 architectures for inputs less than 512 bytes and returns it as a BigInt. ```APIDOC ## legacyHash64BigInt_x86(input) ### Description Computes a 64-bit hash compatible with farmhash@3.3.1 on x86_64 architectures for strings <512 bytes and returns it as a BigInt. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript import { legacyHash64BigInt_x86 } from 'farmhashjs'; legacyHash64BigInt_x86('hello world'); ``` ### Response #### Success Response (200) - **output** (bigint) - The 64-bit hash as a BigInt (x86_64 compatible, <512 bytes). #### Response Example ```json { "output": 16022978042064026561n } ``` ``` -------------------------------- ### legacyHash64_arm Source: https://github.com/crisp-oss/farmhash-js/blob/master/README.md Computes a 64-bit hash compatible with farmhash v3.x on ARM64 architectures. Use this if you need compatibility with older versions or specific platform outputs. ```APIDOC ## legacyHash64_arm(input) ### Description Computes a 64-bit hash compatible with farmhash@3.3.1 on ARM64 architectures. Returns a decimal string. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript import { legacyHash64_arm } from 'farmhashjs'; legacyHash64_arm('hello world'); ``` ### Response #### Success Response (200) - **output** (string) - The 64-bit hash as a decimal string (ARM64 compatible). #### Response Example ```json { "output": "16022978042064026561" } ``` ``` -------------------------------- ### legacyHash64_x86 Source: https://github.com/crisp-oss/farmhash-js/blob/master/README.md Computes a 64-bit hash compatible with farmhash v3.x on x86_64 architectures for inputs less than 512 bytes. Use this for compatibility with older versions or specific platform outputs. ```APIDOC ## legacyHash64_x86(input) ### Description Computes a 64-bit hash compatible with farmhash@3.3.1 on x86_64 architectures for strings <512 bytes. Returns a decimal string. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript import { legacyHash64_x86 } from 'farmhashjs'; legacyHash64_x86('hello world'); ``` ### Response #### Success Response (200) - **output** (string) - The 64-bit hash as a decimal string (x86_64 compatible, <512 bytes). #### Response Example ```json { "output": "16022978042064026561" } ``` ``` -------------------------------- ### legacyHash32_x86 Source: https://github.com/crisp-oss/farmhash-js/blob/master/README.md Computes a 32-bit hash compatible with farmhash v3.x on x86_64 architectures. Use this if you need compatibility with older versions or specific platform outputs. ```APIDOC ## legacyHash32_x86(input) ### Description Computes a 32-bit hash compatible with farmhash@3.3.1 on x86_64 architectures. Returns a number. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript import { legacyHash32_x86 } from 'farmhashjs'; legacyHash32_x86('hello world'); ``` ### Response #### Success Response (200) - **output** (number) - The 32-bit hash as a number (x86_64 compatible). #### Response Example ```json { "output": 1955099599 } ``` ``` -------------------------------- ### legacyHash32_arm Source: https://github.com/crisp-oss/farmhash-js/blob/master/README.md Computes a 32-bit hash compatible with farmhash v3.x on ARM64 architectures. Use this if you need compatibility with older versions or specific platform outputs. ```APIDOC ## legacyHash32_arm(input) ### Description Computes a 32-bit hash compatible with farmhash@3.3.1 on ARM64 architectures. Returns a number. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript import { legacyHash32_arm } from 'farmhashjs'; legacyHash32_arm('hello world'); ``` ### Response #### Success Response (200) - **output** (number) - The 32-bit hash as a number (ARM64 compatible). #### Response Example ```json { "output": 3314386015 } ``` ``` -------------------------------- ### fingerprint64 Source: https://github.com/crisp-oss/farmhash-js/blob/master/README.md Computes a 64-bit hash of the input string. This function provides stable fingerprints consistent across all platforms and versions. The output is a decimal string. ```APIDOC ## fingerprint64(input) ### Description Computes a 64-bit hash as a decimal string. Recommended for modern usage due to platform stability. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript import { fingerprint64 } from 'farmhashjs'; fingerprint64('hello world'); ``` ### Response #### Success Response (200) - **output** (string) - The 64-bit hash as a decimal string. #### Response Example ```json { "output": "6381520714923946011" } ``` ``` -------------------------------- ### fingerprint64BigInt Source: https://github.com/crisp-oss/farmhash-js/blob/master/README.md Computes a 64-bit hash of the input string and returns it as a BigInt. This is useful for applications requiring BigInt representation of the hash. ```APIDOC ## fingerprint64BigInt(input) ### Description Computes a 64-bit hash as a BigInt. Provides a BigInt representation of the hash. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript import { fingerprint64BigInt } from 'farmhashjs'; fingerprint64BigInt('hello world'); ``` ### Response #### Success Response (200) - **output** (bigint) - The 64-bit hash as a BigInt. #### Response Example ```json { "output": 6381520714923946011n } ``` ``` -------------------------------- ### fingerprint32 Source: https://github.com/crisp-oss/farmhash-js/blob/master/README.md Computes a 32-bit hash of the input string. This function provides stable fingerprints consistent across all platforms and versions. The output is a number. ```APIDOC ## fingerprint32(input) ### Description Computes a 32-bit hash as a number. Recommended for modern usage due to platform stability and performance. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript import { fingerprint32 } from 'farmhashjs'; fingerprint32('hello world'); ``` ### Response #### Success Response (200) - **output** (number) - The 32-bit hash as a number. #### Response Example ```json { "output": 430397466 } ``` ``` -------------------------------- ### hash64 Alias Source: https://github.com/crisp-oss/farmhash-js/blob/master/README.md An alias for `fingerprint64`, providing a shorter name for the modern 64-bit stable fingerprint function. ```APIDOC ## hash64(input) ### Description Alias for `fingerprint64`. Computes a 64-bit hash as a decimal string. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript import { hash64 } from 'farmhashjs'; hash64('hello world'); ``` ### Response #### Success Response (200) - **output** (string) - The 64-bit hash as a decimal string. #### Response Example ```json { "output": "6381520714923946011" } ``` ``` -------------------------------- ### hash32 Alias Source: https://github.com/crisp-oss/farmhash-js/blob/master/README.md An alias for `fingerprint32`, providing a shorter name for the modern 32-bit stable fingerprint function. ```APIDOC ## hash32(input) ### Description Alias for `fingerprint32`. Computes a 32-bit hash as a number. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript import { hash32 } from 'farmhashjs'; hash32('hello world'); ``` ### Response #### Success Response (200) - **output** (number) - The 32-bit hash as a number. #### Response Example ```json { "output": 430397466 } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.