# Chalk SQL Reference: Hash Functions
source: https://docs.chalk.ai/chalksql-docs#section-hash-functions

## `crc32(binary)`
source: https://docs.chalk.ai/chalksql-docs#crc32

Calculates the CRC32 checksum of `binary` data.

**Parameters**

- `binary`: `large_binary`
  The input `binary` value.

## `hmac_md5(binary, key)`
source: https://docs.chalk.ai/chalksql-docs#hmac_md5

Computes HMAC-MD5 authentication code for data using a secret `key`.

**Parameters**

- `binary`: `large_binary`
  The input `binary` value.
- `key`: `large_binary`
  The map `key` to read or update.

## `hmac_sha1(binary, key)`
source: https://docs.chalk.ai/chalksql-docs#hmac_sha1

Computes HMAC-SHA1 authentication code for data using a secret `key`.

**Parameters**

- `binary`: `large_binary`
  The input `binary` value.
- `key`: `large_binary`
  The map `key` to read or update.

## `hmac_sha256(binary, key)`
source: https://docs.chalk.ai/chalksql-docs#hmac_sha256

Computes HMAC-SHA256 authentication code for data using a secret `key`.

**Parameters**

- `binary`: `large_binary`
  The input `binary` value.
- `key`: `large_binary`
  The map `key` to read or update.

## `hmac_sha512(binary, key)`
source: https://docs.chalk.ai/chalksql-docs#hmac_sha512

Computes HMAC-SHA512 authentication code for data using a secret `key`.

**Parameters**

- `binary`: `large_binary`
  The input `binary` value.
- `key`: `large_binary`
  The map `key` to read or update.

## `iceberg_bucket(x, y)`
source: https://docs.chalk.ai/chalksql-docs#iceberg_bucket

Returns the Iceberg bucket id for a value: (murmur3_x86_32(value) & 2147483647) % num_buckets.

**Examples**

```sql
SELECT iceberg_bucket(34, 100);
```

```sql
SELECT iceberg_bucket('iceberg', 100);
```

**Overloads**

#### `iceberg_bucket(x, y)`

Iceberg's bucket[N] partition transform for an integer value.

**Parameters**

- `x`: `int64`
  The input value.
- `y`: `int64`
  The second input value.

#### `iceberg_bucket(x, y)`

Iceberg's bucket[N] partition transform for a string value.

**Parameters**

- `x`: `large_string`
  The input value.
- `y`: `int64`
  The second input value.

## `md5(binary)`
source: https://docs.chalk.ai/chalksql-docs#md5

Computes the MD5 hash of `binary` data.

**Parameters**

- `binary`: `large_binary`
  The input `binary` value.

## `sha1(binary)`
source: https://docs.chalk.ai/chalksql-docs#sha1

Computes the SHA-1 hash of `binary` data.

**Parameters**

- `binary`: `large_binary`
  The input `binary` value.

## `sha256(binary)`
source: https://docs.chalk.ai/chalksql-docs#sha256

Computes the SHA-256 hash of `binary` data.

**Parameters**

- `binary`: `large_binary`
  The input `binary` value.

## `sha512(binary)`
source: https://docs.chalk.ai/chalksql-docs#sha512

Computes the SHA-512 hash of `binary` data.

**Parameters**

- `binary`: `large_binary`
  The input `binary` value.

## `spooky_hash_v2_32(binary)`
source: https://docs.chalk.ai/chalksql-docs#spooky_hash_v2_32

Computes a 32-bit SpookyHash V2 hash of `binary` data.

**Parameters**

- `binary`: `large_binary`
  The input `binary` value.

## `spooky_hash_v2_64(binary)`
source: https://docs.chalk.ai/chalksql-docs#spooky_hash_v2_64

Computes a 64-bit SpookyHash V2 hash of `binary` data.

**Parameters**

- `binary`: `large_binary`
  The input `binary` value.

## `xxhash64(binary, ...)`
source: https://docs.chalk.ai/chalksql-docs#xxhash64

Computes a 64-bit XXHash of `binary` data, optionally with a `seed`.

**Overloads**

#### `xxhash64(binary, seed)`

Computes a 64-bit XXHash of `binary` data with a `seed`.

**Parameters**

- `binary`: `large_binary`
  The input `binary` value.
- `seed`: `int64`

#### `xxhash64(binary)`

Computes a 64-bit XXHash of `binary` data.

**Parameters**

- `binary`: `large_binary`
  The input `binary` value.
