Lower case feature for hashing #102
martijn-dev
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
This is a good idea, more broadly it's about whether exact matching is case-sensitive (as it is currently) or not (your proposal). One thing I'd be wary about is locale-aware case sensitivity: For the normalisation part (and the casing too for that matter), the lossy aspects of the transformation could cause some issues where two different underlying values end up with the same hash (which would cause a unique constraint failure on write). |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi François,
First of all, thanks for creating this extension. It has been working great for me so far!
I'm working with the hashing option and I was wondering if it is possible to lowercase the input before making a hash out of it.
For example:
We have the following model:
The user provides a name:
MartijN
.Now I would like to be able to find this user back with a lowercase string
martijn
, but still decrypt the name field back toMartijN
.Would it be possible to add a "toLowerCase" feature to the input for the hash. (and maybe even to the
where
query on a search, although you can do that outside the extenstion as well.)Something like
@encryption:hash(name)?transform=lowercase
Would love to hear your opinion/ideas!
Cheers,
Martijn
EDIT:
While submitting I realized that other forms of input transformation might be relevant as well. You might want to find a name like
François
back with an inputfrancois
.JS has a function for this:
"François".normalize('NFD').replace(/\p{Diacritic}/gu, '');
(https://stackoverflow.com/a/51874002/16813398)
Beta Was this translation helpful? Give feedback.
All reactions