-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion: Allow dynamic variable types in datum #135
Comments
hm... will think about this - after all, I'm an old-school OOP programmer, so loosely type checking works against my basic instincts ;-) I wonder what other problems this might create.... But will make an experiment. |
Yes, I understand your aversion of giving in to loose typing. I'm not a fan myself either (JavaScript pstsd). So if you find this use case something worth taking into account, and there is no better solution, and there are no adverse effects, I'd say this is the way to go. |
I will try to release this as part of version 0.11.0. However, it has a consequence on the JSON serialization. For example, if
But when "encrypting", resulting in a string, it looks like:
So - whatever is used for reading the json need to be able to handle that the attributes can both be numerical and strings. |
For me that's okay. I'm working on an R package for reading in CARP data (still in a very early stage) and any type would work fine there (even mixed, sometimes double sometimes string). |
Context
I am making my own
PrivacySchema
and one of its purposes is that needs to encrypt GPS coordinates since these are highly identifying data.Motivation
Such a
locationAnonymizer
(using theflutter_sodium
library would look like thisHowever, this does not work as
ld..longitude
is adouble
(they are coordinates after all) while the encrypted value is astring
.Attempted solutions
I've some up with several solutions so far:
LocationDatum
. However, this variable would then not be used in other functions so it's essentially pointless.LocationDatum
myself to changelongitude
from a double to a string (usingtoString()
). However, methods cannot be override outside their library.Proposed solution
In the respective packages with the
Datum
s, change types from double to dynamic (or to string altogether) to allow for exactly this behaviour. I'm not sure if there are any downside for this other than giving in to a more loose typed way of programming.The text was updated successfully, but these errors were encountered: