---
title: mmpm_set_hash_func
description: "多模规则匹配引擎注册哈希计算函数。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/2530/ida/kunpeng_datadistribution_01_0013.html
sourcePath: /source/zh/kunpengboostkithistory/2530/ida/kunpeng_datadistribution_01_0013.html
indexId: 6c93b7a55bd075dc0e688147a5a7a0e877cc2c5249723507dfdb27b3e66bd46e80
---
# mmpm_set_hash_func

#### 接口功能

多模规则匹配引擎注册哈希计算函数。


#### 接口定义

```
int mmpm_set_hash_func(mmpm_handler_t *handler, hash_calc_func hash_func);
```


#### 参数说明

| 参数名 | 描述 | 取值范围 | 输入/输出 |
| --- | --- | --- | --- |
| handler | 匹配引擎句柄 | 非NULL | 输入 |
| hash\_func | 哈希函数指针 | 非NULL | 输入 |


#### 返回值

- 成功：返回0。
- 失败：返回错误码。
