# Hash function in painless

**URL:** <https://discuss.elastic.co/t/hash-function-in-painless/169721>\
**Category:** Elasticsearch\
**Tags:** painless\
**Created:** [February 24, 2019, 12:58pm UTC](https://discuss.elastic.co/t/hash-function-in-painless/169721 "2019-02-24T12:58:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yaming\_Ma](https://avatars.discourse-cdn.com/v4/letter/y/c68b51/32.png) [@Yaming\_Ma](https://discuss.elastic.co/u/Yaming_Ma)\
**Post date:** [February 24, 2019, 12:58pm UTC](https://discuss.elastic.co/t/hash-function-in-painless/169721/1 "2019-02-24T12:58:24Z")

</div>

Hi guys,

I'm new to ES painless script. Is there any approach to do MD5 hash on certain fields in painless? I checked the API reference but found no such API. Or what the most efficient approach is if I want to do run MD5 hash on the fields? E.g. I have a field called a and a user provided string called b, I want to aggregate on md5(a+b) during query...

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 24, 2019, 12:58pm UTC](https://discuss.elastic.co/t/hash-function-in-painless/169721/2 "2019-03-24T12:58:26Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
