2) Also In the LR Paradata Spec 1.0, it shows an activity having a measure property which then has a float sub property(ie count, value) stays as a float in the JSON. We are using LRSignature written by Jim Klo, which during signing, normalizes the document and converts all float numbers and booleans into strings. So our float numbers during publishing are converted to strings.
So should the spec specify the floats as strings instead or are we missing something? On a side note I would think that if floats are converted to strings, perhaps for consistency sake, integers in the activity should also be strings, ie scaleMin, scaleMax, count and sampleSize. Then a consumer of the documents can just convert all string values into floats.
Let me be sure I understand what you're getting at.. If you put a native floating point number in any Json field in an LR envelope, the PGP signing might break b/c of different implementations of float representation by different languages?
But if you convert the float to a string, then you solve that problem, but it's not obvious that your number is a number, to the consumers of the envelope?
Solutions include:1) Submitters convert any float to a string before signing it1a) Prohibit native floats in envelopes
2) Change the spec
I'm not sure I understand what the change in the spec would mean? Allow floating point? But then we have the problem you alluded to which is floats are implementation dependent and hard for a developer to be sure they're getting the same result on different platforms and languages?
I would vote that we should just use stringified floats everywhere in the envelope as a simple and fairly workable concept, since duck typing in json is not so painful with most language libs..
--
You received this message because you are subscribed to the Google Groups "Learning Registry Developers List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to learningreg-d...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Intuitively I'd think dropping the value only increases entropy as little as possible..
I'm shooting from the hip. I can't see specific implications between them (other than dropping k/v pairs or just dropping values)..
Steve
+1
Converting float to int for purposes of signing seems scary in principle but perhaps not bad for our purposes. I'm open.Jim, I thought the consensus prior to Dave (Marie and me) was to convert floats to the string "null" -- but Dave's proposal of converts floats to ints has merit too I think.. (How can it be worse than converting to null?)
Hope you guys don't mind me adding my two cents about this, I might be way of base though.
1) When i brought up this issue I was actually referring to the issue in LRSignature that during normalizing its actually making changes to the envelope too. Because if my JSON has a float, the float is not only converted to a string
for figuring out the hash but ts also being converted to a string in the envelope that is being published. I think it has do to
sigObj = envelope.copy(). Unless this was purposefully done I would think this should be a deep copy so the envelope that has a float stays a float and not converted to a string in the envelope

2) From what I take away from this thread is that the envelope that we are publishing may contain booleans, ints and floats.
Its just that when we are signing/verifying they either need to be removed/changed so the hashes stay consistent across platforms. So I agree with everyone else having the closest hash would be the best, so leaving the key and making the value "null" sounds good. The only thing I wonder though is if the hash is allowed to still have integers, why can't we at least convert the float into an integer. 3.9->3. And hash that, then at least in the hash the most that anything could be off by since it was signed would be .9999…….
On May 30, 2013, at 1:25 PM, <finke...@gmail.com>wrote:Hope you guys don't mind me adding my two cents about this, I might be way of base though.
1) When i brought up this issue I was actually referring to the issue in LRSignature that during normalizing its actually making changes to the envelope too. Because if my JSON has a float, the float is not only converted to a string
for figuring out the hash but ts also being converted to a string in the envelope that is being published. I think it has do to
sigObj = envelope.copy(). Unless this was purposefully done I would think this should be a deep copy so the envelope that has a float stays a float and not converted to a string in the envelopeit shouldn't be changing the actual envelope at all… if it is that's a really big bug (and I think I totally misunderstood your initial claim previously)… but not so bad in that at least the final output contains the modified version with the signature - it's just a pain because it didn't publish exactly what you expected.I see that it is doing a dict.copy() first, which I now see in the Python docs is a shallow copy - I will fix globally as I think this is pervasive to other areas.
<Notification Center-1.png>
2. the problem is 'avoidable' with proper knowledge.
I may be more confused than is helpful. That said, I think it makes more sense to keep the integer equivalent (agree that it's truncate not round) of a number rather than drop the entire number value (and replacing with string "null")?
I can see all kinds of problems with having multiple json renderings permitted, so better to keep it simple.
That said, beyond reducing all numbers to only significant digits, could we suggest in/near the spec that prior to signing, submitters can convert floats to IEEE 754 string versions of their floats and provide a json schema somewhere (else?) that indicates those fields are string encoded numbers if maintaining full security over every bit of their envelope is vital? Tools like this would make it pretty easy to do the conversion if it really matters to people? http://www.h-schmidt.net/FloatConverter/
This would only be necessary if the submitter can't handle the security exposure of having the least significant digits of their floats being unsigned (which is all I think we're chasing in this bug anyway?)..Am I missing the main story?