$toHashedIndexKey

Hi everyone,

I am trying to mask a field before exporting it into S3 using atlas federation.
the masked output should be unique for unique inputs and be identical for identical inputs.
this is because we are joining collections later using this field.

MD5 hash will be a perfect solution for masking but unfortunately its not available in atlas federation since the server side JavaScript execution is disabled in federation.

I found $toHashedIndexKey operator but I don’t know what hash function does it uses and is there high chances of hash collision?

Thanks