Browser version on-line. Re: JSON.canonicalize()

2018-03-17 Thread Anders Rundgren
F.Y.I. https://cyberphone.github.io/doc/security/browser-json-canonicalization.html thanx, Anders ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Expanding Object Shorthand

2018-03-17 Thread Sebastian Malton
You make very good points however the last point doesn't haven't the same usability as my proposal since with mine multiple different objects can be selected from at a time. 

Re: Expanding Object Shorthand

2018-03-17 Thread Oriol _
> the last point doesn't haven't the same usability as my proposal since with > mine multiple different objects can be selected from at a time I believe that you could use Bob's proposal like this: ```js var obj = {...obj1.{prop1, prop2}, ...obj2.{prop3, prop4}}; ``` -- Oriol __

Hashable vs Canonicalizable. Re: JSON.canonicalize()

2018-03-17 Thread Anders Rundgren
A "Hashable" format does not have to comply with the original; the only requirement is that it is reproducible. However, I have difficulties coming up with a good argument for not sticking to the original. If you stick to the original, then the terms Hashable and Canonicalizable become fully in

add reverse() method to strings

2018-03-17 Thread Grigory Hatsevich
Hi! I would propose to add reverse() method to strings. Something equivalent to the following: String.prototype.reverse = function(){ return this.split('').reverse().join('') } It seems natural to have such method. Why not? ___ es-discuss mailing

Re: add reverse() method to strings

2018-03-17 Thread Oriol _
Be aware your code breaks pair surrogates, which might be undesirable: ```js var str = "a_\uD83D\uDE80_b"; str.split("").reverse().join(""); // "b_\uDE80\uD83D_a" :( [...str].reverse().join(""); // "b_\uD83D\uDE80_a" :) ``` --Oriol ___ es-discuss

Re: add reverse() method to strings

2018-03-17 Thread Claude Pache
> Le 17 mars 2018 à 19:29, Oriol _ a écrit : > > Be aware your code breaks pair surrogates, which might be undesirable: > > ```js > var str = "a_\uD83D\uDE80_b"; > str.split("").reverse().join(""); // "b_\uDE80\uD83D_a" :( > [...str].reverse().join(""); // "b_\uD83D\uDE80_a" :) > ``` > >

Re: add reverse() method to strings

2018-03-17 Thread Thomas Grainger
String.prototype.reverse() might break web compatibility, how about String.prototype.turnyRoundy()? On 17 Mar 2018 18:47, "Claude Pache" wrote: > > > Le 17 mars 2018 à 19:29, Oriol _ a écrit : > > Be aware your code breaks pair surrogates, which might be undesirable: > > ```js > var str = "a_\u

Re: Summary of Input. Re: JSON.canonicalize()

2018-03-17 Thread Mike Samuel
On Fri, Mar 16, 2018 at 9:42 PM, Anders Rundgren < anders.rundgren@gmail.com> wrote: > Scott A: > https://en.wikipedia.org/wiki/Security_level > "For example, SHA-256 offers 128-bit collision resistance" > That is, the claims that there are cryptographic issues w.r.t. to Unicode > Normalizatio

Re: Summary of Input. Re: JSON.canonicalize()

2018-03-17 Thread Mike Samuel
On Fri, Mar 16, 2018 at 9:42 PM, Anders Rundgren < anders.rundgren@gmail.com> wrote: > > > On my part I added canonicalization to my ES6.JSON compliant Java-based > JSON tools. A single line did 99% of the job: > https://github.com/cyberphone/openkeystore/blob/jose-compati > ble/library/src/o

Re: add reverse() method to strings

2018-03-17 Thread Felipe Nascimento de Moura
I would use `Array.from`: ``` str = "a_\uD83D\uDE80_b" Array.from(str).reverse().join('') ``` But I also upvote the idea of having a reverse method in strings :) If `reverse` might cause some retrocompatibility problem (although I don't think it requires params, what would pretty much avoid diff

Re: add reverse() method to strings

2018-03-17 Thread J Decker
Other than for amusement or programming challenge I've never found a use for it? Do you have one? On Sat, Mar 17, 2018 at 4:11 PM, Felipe Nascimento de Moura < felipenmo...@gmail.com> wrote: > I would use `Array.from`: > > ``` > str = "a_\uD83D\uDE80_b" > Array.from(str).reverse().join('') > ```

Re: add reverse() method to strings

2018-03-17 Thread Mike Samuel
Previous discussion: https://esdiscuss.org/topic/wiki-updates-for-string-number-and-math-libraries#content-1 """ String.prototype.reverse(), as proposed, corrupts supplementary characters. Clause 6 of Ecma-262 redefines the word "character" as "a 16-bit unsigned value used to represent a single 16

Re: add reverse() method to strings

2018-03-17 Thread Mathias Bynens
So far no one has provided a real-world use case. On Mar 18, 2018 10:15, "Mike Samuel" wrote: > Previous discussion: https://esdiscuss.org/topic/wiki-updates-for-string- > number-and-math-libraries#content-1 > > """ > String.prototype.reverse(), as proposed, corrupts supplementary > characters.

Re: Expanding Object Shorthand

2018-03-17 Thread Michael Theriot
Not up to speed with any pitfalls already discussed but for what it's worth I tried this at least a few times when destructuring landed and was disappointed it didn't work. > On Mar 16, 2018, at 4:30 PM, Sebastian Malton wrote: > > Hello currently the following is a possible way to define an o

Re: Expanding Object Shorthand

2018-03-17 Thread Naveen Chawla
Yes it seems like a natural combination of the destructuring and object shorthand features (the `=` version that is). Can anybody name the pitfalls or point to where they have been mentioned (if any have been)? On Sun, 18 Mar 2018 at 08:52 Michael Theriot wrote: > Not up to speed with any pitfal

Re: Summary of Input. Re: JSON.canonicalize()

2018-03-17 Thread Anders Rundgren
Hi Guys, Pardon me if you think I was hyperbolic, The discussion got derailed by the bogus claims about hash functions' vulnerability. F.Y.I: Using ES6 serialization methods for JSON primitive types is headed for standardization in the IETF. https://www.ietf.org/mail-archive/web/jose/current/m