Documentation

    hash

    Calculate a numeric hash of one or more values. It isn't a cryptographic hash, so don't use it for security.

    Try an expression

    In Formula, enter the expression and set Output type to VARCHAR.

    Expression

    hash('🦆')

    Result

    '4164431626903154684'

    The expression returns UBIGINT. Formula stores it as VARCHAR in this example. To use your own data, replace the example values with column names. Keep format strings and other options as written.

    Arguments and types

    hash(value, ...)
    value
    Any value
    Supported signatures (1)
    hash(value: ANY, ...: ANY) → UBIGINT

    The result type can depend on the input types. See DuckDB for the full argument rules.

    Things to know

    Hash results can change between DuckDB versions; avoid treating them as permanent identifiers.

    With a missing first argument

    hash(NULL::VARCHAR)

    '13787848793156543929'

    Browse textDuckDB documentation

    Function metadata from DuckDB, used under the MIT license.