# Chalk Python SDK Reference: Hash Functions
source: https://docs.chalk.ai/api-docs#section-hash-functions

## `md5(expr)`
source: https://docs.chalk.ai/api-docs#md5

Compute the MD5 hash of some bytes.

**Parameters**

- `expr`: `Any`
  A bytes feature to hash.

**Examples**

```python
import chalk.functions as F
from chalk.features import _, features
@features
class User:
   id: str
   bytes_feature: bytes
   md5_bytes: bytes = F.md5(_.bytes_feature)
```

## `sha1(expr)`
source: https://docs.chalk.ai/api-docs#sha1

Compute the SHA-1 hash of some bytes.

**Parameters**

- `expr`: `Any`
  A bytes feature to hash.

**Examples**

```python
import chalk.functions as F
from chalk.features import _, features
@features
class User:
   id: str
   bytes_feature: bytes
   sha1_bytes: bytes = F.sha1(_.bytes_feature)
```

## `sha256(expr)`
source: https://docs.chalk.ai/api-docs#sha256

Compute the SHA-256 hash of some bytes.

**Parameters**

- `expr`: `Any`
  A bytes feature to hash.

**Examples**

```python
import chalk.functions as F
from chalk.features import _, features
@features
class User:
   id: str
   bytes_feature: bytes
   sha256_bytes: bytes = F.sha256(_.bytes_feature)
```

## `sha512(expr)`
source: https://docs.chalk.ai/api-docs#sha512

Compute the SHA-512 hash of some bytes.

**Parameters**

- `expr`: `Any`
  A bytes feature to hash.

**Examples**

```python
import chalk.functions as F
from chalk.features import _, features
@features
class User:
   id: str
   bytes_feature: bytes
   sha512_bytes: bytes = F.sha512(_.bytes_feature)
```

## `spooky_hash_v2_32(expr)`
source: https://docs.chalk.ai/api-docs#spooky_hash_v2_32

Compute the SpookyHash V2 32-bit hash of a string. This hash function is not cryptographically secure, but it is deterministic and fast.

**Parameters**

- `expr`: `Any`
  A string feature to hash.

**Examples**

```python
import chalk.functions as F
from chalk.features import _, features
@features
class User:
   id: str
   name: str
   name_hash: bytes = F.spooky_hash_v2_32(
       F.string_to_bytes(_.name, "utf-8")
   )
```

## `spooky_hash_v2_64(expr)`
source: https://docs.chalk.ai/api-docs#spooky_hash_v2_64

Compute the SpookyHash V2 64-bit hash of a string. This hash function is not cryptographically secure, but it is deterministic and fast.

**Parameters**

- `expr`: `Any`
  A string feature to hash.

**Examples**

```python
import chalk.functions as F
from chalk.features import _, features
@features
class User:
   id: str
   name: str
   name_hash: bytes = F.spooky_hash_v2_64(
       F.string_to_bytes(_.name, "utf-8")
   )
```
