# Hashcode in Programmable Filter

**URL:** https://discourse.paraview.org/t/hashcode-in-programmable-filter/7608
**Category:** ParaView Support
**Created:** [July 14, 2021, 7:38am UTC](https://discourse.paraview.org/t/hashcode-in-programmable-filter/7608 "2021-07-14T07:38:36Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![gizem](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/g/7ea924/32.png) [@gizem](https://discourse.paraview.org/u/gizem)
#### Post date: [July 14, 2021, 7:38am UTC](https://discourse.paraview.org/t/hashcode-in-programmable-filter/7608/1 "2021-07-14T07:38:36Z")

</div>

Hello,  
I’ve been trying to convert a Point Array of the Properties Panel (a double value) into hashcode with the help of the programmable filter. I tried several times, but it never worked.  
I expected to see another parameter on the Spreadsheet view, but I never was able to. Do I have to define that additionally?  
I especially had problems in defining the input and output and extracting/using the Point array in the filter itself. I tried to convert via the hash() method.  
I’d be thankful for any advice

---

<div class="post-metadata">

### Author: ![gizem](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/g/7ea924/32.png) [@gizem](https://discourse.paraview.org/u/gizem)
#### Post date: [July 14, 2021, 8:19am UTC](https://discourse.paraview.org/t/hashcode-in-programmable-filter/7608/2 "2021-07-14T08:19:57Z")

</div>

Now I have following:

input = inputs[0]  
pointData = input.GetPointData()  
firstUid = pointData.GetArray(‘uid\_1’)  
firstHash = hash(firstUid)  
output.PointData.append(firstHash, ‘‘firstHash“)

I can see firstHash in the Spreadsheet view, however it is the same value for every uid\_1 (Originally I am working on Particles, each having their own uid)

What did I do wrong?

---

<div class="post-metadata">

### Author: ![nicolas.vuaille](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nicolas.vuaille/32/5873_2.png) [@nicolas.vuaille](https://discourse.paraview.org/u/nicolas.vuaille)
#### Post date: [July 15, 2021, 8:19am UTC](https://discourse.paraview.org/t/hashcode-in-programmable-filter/7608/3 "2021-07-15T08:19:59Z")

</div>

Here the `hash()` method only hashes the pointer to the data array, not the contents of the array.

You need a for loop to hash each of your values, and add them into a new array.

---

<div class="post-metadata">

### Author: ![gizem](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/g/7ea924/32.png) [@gizem](https://discourse.paraview.org/u/gizem)
#### Post date: [July 15, 2021, 9:50am UTC](https://discourse.paraview.org/t/hashcode-in-programmable-filter/7608/4 "2021-07-15T09:50:33Z")

</div>

Thank you!

---

<div class="post-metadata">

### Author: ![gizem](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/g/7ea924/32.png) [@gizem](https://discourse.paraview.org/u/gizem)
#### Post date: [July 16, 2021, 10:11am UTC](https://discourse.paraview.org/t/hashcode-in-programmable-filter/7608/5 "2021-07-16T10:11:53Z")

</div>

Hello,  
I tried to iterate as you said, but I am still not familiar with the Programmable filter.  
How can I use the for loop in particular?

---

<div class="post-metadata">

### Author: ![gizem](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/g/7ea924/32.png) [@gizem](https://discourse.paraview.org/u/gizem)
#### Post date: [July 16, 2021, 11:19am UTC](https://discourse.paraview.org/t/hashcode-in-programmable-filter/7608/6 "2021-07-16T11:19:06Z")

</div>

Okay, so here is what I found out: With firstUid = pointData.GetArray(‘uid\_1’) Paraview returns a None-Value. This explains why firstUid[i].GetValue() was throwing an Exception the whole time, when I tried using the for loop.  
Is there another way to get the Point Array?
