buffer: add isLatin1 - #66298
buffer: add isLatin1#66298
Conversation
|
Review requested:
|
|
I don't think |
|
Yeah, I'm going to rename to |
5826c3c to
98b8ffc
Compare
98b8ffc to
07f71ca
Compare
07f71ca to
090b087
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #66298 +/- ##
==========================================
- Coverage 90.36% 90.35% -0.01%
==========================================
Files 792 792
Lines 275386 275412 +26
Branches 52770 52786 +16
==========================================
+ Hits 248859 248860 +1
- Misses 16936 16973 +37
+ Partials 9591 9579 -12
🚀 New features to boost your workflow:
|
addaleax
left a comment
There was a problem hiding this comment.
isLatin1String would be much better naming because it describes what the method actually tests for. The WebIDL ByteString type describes a legacy type that stems from the lack of commitment to a specific encoding in early HTTP versions other than vague ASCII backwards compatibility, and it's not actually used widely outside of HTTP-specific APIs for that (very good) reason.
I don't think
isLatin1is a good name,\u0100can definitely be a 2-byte latin1 string
This is not a statement that makes sense, \u0100 cannot be represented in Latin-1, and there are, by definition, no 2-byte Latin-1 strings to begin with -- maybe you're referring to the idea that the byte sequence 01 00 can be Latin-1, but this method takes a string as an argument, i.e. a character sequence, not a byte sequence
Implements a fast check to determine if a string is a valid byte string (only chars <= 0xff). Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #66298 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Nagy <ronagy@icloud.com>
|
Landed in b59840b |
|
Landed in 8f43e88 |
|
Looks like it was landed twice: first through commit-queue and once through manual actions, so the later commit b59840b is an empty commit. |
Implements a fast check to determine if a string is a valid byte string (only chars <= 0xff). Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#66298 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Nagy <ronagy@icloud.com>
Implements a fast check to determine if a string is a valid byte string (only chars <= 0xff). Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#66298 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Nagy <ronagy@icloud.com>
|
Ugh, I think that's happened before also. I removed the commit-queue label and landed it manually because I had convinced myself somehow that the commit was going to need to be tweaked before merging but then realized it was fine. |
Implements a fast check to determine if a string is a valid byte string (only chars <= 0xff). Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #66298 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Nagy <ronagy@icloud.com>
Implements a fast check to determine if a string is a valid byte string (only chars <= 0xff). Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #66298 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Nagy <ronagy@icloud.com>
Implements a fast check to determine if a string is a valid byte string (only chars <= 0xff). Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #66298 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Nagy <ronagy@icloud.com>
Implements a fast check to determine if a string is a valid byte string (only chars <= 0xff). Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #66298 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Nagy <ronagy@icloud.com>
Implements a fast check to determine if a string is a valid byte string (only chars <= 0xff). Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#66298 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Nagy <ronagy@icloud.com>
Implements a fast check to determine if a string is a valid byte string (only chars <= 0xff). Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#66298 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Nagy <ronagy@icloud.com>
Implements a fast check to determine if a string is a valid byte string (only chars <= 0xff). Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#66298 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Nagy <ronagy@icloud.com>
Implements a fast check to determine if a string is a valid byte string (only chars <= 0xff). Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#66298 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Nagy <ronagy@icloud.com>
Implements a fast check to determine if a string is a valid byte string (only chars <= 0xff). Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#66298 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Nagy <ronagy@icloud.com>
Implements a fast check to determine if a string is a valid byte string (only chars <= 0xff). Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#66298 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Nagy <ronagy@icloud.com>
Implements a fast check to determine if a string is a valid byte string (only chars <= 0xff). Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#66298 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Nagy <ronagy@icloud.com>
Implements a fast check to determine if a string is a valid byte string (only chars <= 0xff). Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#66298 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Nagy <ronagy@icloud.com>
Implements a fast check to determine if a string is a valid byte string (only chars <= 0xff). Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#66298 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Nagy <ronagy@icloud.com>
Implements a fast check to determine if a string is a valid byte string (only chars <= 0xff). Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#66298 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Nagy <ronagy@icloud.com>
Implements a fast check to determine if a string is a valid byte string (only chars <= 0xff). Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#66298 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Nagy <ronagy@icloud.com>
Implements a fast check to determine if a string is a valid byte string (only chars <= 0xff). Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#66298 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Nagy <ronagy@icloud.com>
Implements a fast check to determine if a string is a valid byte string (only chars <= 0xff). Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#66298 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Nagy <ronagy@icloud.com>
Implements a fast check to determine if a string is a valid byte string (only chars <= 0xff). Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#66298 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Nagy <ronagy@icloud.com>
Notable changes: benchmark: * (SEMVER-MINOR) add http header validator benchmark (James M Snell) #66334 buffer: * (SEMVER-MINOR) add isLatin1 (James M Snell) #66298 * (SEMVER-MINOR) add isLatin1 (James M Snell) #66298 * (SEMVER-MINOR) add Buffer.stringLength() (Matteo Collina) #66064 build, doc: * move to redesign (Aviv Keller) #62045 http: * (SEMVER-MINOR) add isValidHeaderName() and isValidHeaderValue() (James M Snell) #66334 http2: * (SEMVER-MINOR) add new connectionWindowSize option (Tim Perry) #65619 lib: * (SEMVER-MINOR) fix stream loading bug in node:bench (James M Snell) #66114 perf_hooks: * (SEMVER-MINOR) fix truncation of monitorEventLoopDelay() resolution (James M Snell) #66115 * (SEMVER-MINOR) allow RecordableHistogram to record 0 (James M Snell) #66114 * (SEMVER-MINOR) add histogram.diff() (James M Snell) #66099 * (SEMVER-MINOR) report histogram memory to V8 (James M Snell) #66099 * (SEMVER-MINOR) add histogram.snapshot() (James M Snell) #66099 * (SEMVER-MINOR) add histogram export format version 2 (James M Snell) #66098 * (SEMVER-MINOR) harden histogram CBOR import validation (James M Snell) #66098 process: * (SEMVER-MINOR) graduate process.ref/unref from experimental (James M Snell) #66213 sqlite: * (SEMVER-MINOR) rename DatabaseSync and StatementSync (Guilherme Araújo) #65988 src: * (SEMVER-MINOR) add --process-timeout=N (James M Snell) #66138 * (SEMVER-MINOR) expose size and count in heap profile output (Ilyas Shabi) #65737 * (SEMVER-MINOR) let embedders exempt linked bindings from the addon permission (Shelley Vohr) #66067 test: * deflake sliding window histogram test (James M Snell) #66132 PR-URL: #66546
Notable changes: buffer: * (SEMVER-MINOR) add isLatin1 (James M Snell) #66298 * (SEMVER-MINOR) add Buffer.stringLength() (Matteo Collina) #66064 build, doc: * move to redesign (Aviv Keller) #62045 http: * (SEMVER-MINOR) add isValidHeaderName() and isValidHeaderValue() (James M Snell) #66334 http2: * (SEMVER-MINOR) add new connectionWindowSize option (Tim Perry) #65619 perf_hooks: * (SEMVER-MINOR) fix truncation of monitorEventLoopDelay() resolution (James M Snell) #66115 * (SEMVER-MINOR) allow RecordableHistogram to record 0 (James M Snell) #66114 * (SEMVER-MINOR) add histogram.diff() (James M Snell) #66099 * (SEMVER-MINOR) report histogram memory to V8 (James M Snell) #66099 * (SEMVER-MINOR) add histogram.snapshot() (James M Snell) #66099 * (SEMVER-MINOR) add histogram export format version 2 (James M Snell) #66098 * (SEMVER-MINOR) harden histogram CBOR import validation (James M Snell) #66098 process: * (SEMVER-MINOR) graduate process.ref/unref from experimental (James M Snell) #66213 sqlite: * (SEMVER-MINOR) rename DatabaseSync and StatementSync (Guilherme Araújo) #65988 src: * (SEMVER-MINOR) add --process-timeout=N (James M Snell) #66138 * (SEMVER-MINOR) expose size and count in heap profile output (Ilyas Shabi) #65737 * (SEMVER-MINOR) let embedders exempt linked bindings from the addon permission (Shelley Vohr) #66067 PR-URL: #66546
Notable changes: buffer: * (SEMVER-MINOR) add isLatin1 (James M Snell) #66298 * (SEMVER-MINOR) add Buffer.stringLength() (Matteo Collina) #66064 build, doc: * move to redesign (Aviv Keller) #62045 doc: * promote Alpine Linux to tier 2 support (Stewart X Addison) #63737 http: * (SEMVER-MINOR) add isValidHeaderName() and isValidHeaderValue() (James M Snell) #66334 http2: * (SEMVER-MINOR) add new connectionWindowSize option (Tim Perry) #65619 perf_hooks: * (SEMVER-MINOR) fix truncation of monitorEventLoopDelay() resolution (James M Snell) #66115 * (SEMVER-MINOR) allow RecordableHistogram to record 0 (James M Snell) #66114 * (SEMVER-MINOR) add histogram.diff() (James M Snell) #66099 * (SEMVER-MINOR) add histogram.snapshot() (James M Snell) #66099 * (SEMVER-MINOR) harden histogram CBOR import validation (James M Snell) #66098 process: * (SEMVER-MINOR) graduate process.ref/unref from experimental (James M Snell) #66213 sqlite: * (SEMVER-MINOR) rename DatabaseSync and StatementSync (Guilherme Araújo) #65988 src: * (SEMVER-MINOR) add --process-timeout=N (James M Snell) #66138 * (SEMVER-MINOR) expose size and count in heap profile output (Ilyas Shabi) #65737 * (SEMVER-MINOR) let embedders exempt linked bindings from the addon permission (Shelley Vohr) #66067 PR-URL: #66546
Implements a fast check to determine if a string is
Latin1a byte stringLatin1.Can be many times faster than the equivalent regex check.
(the larger perf gap there is with concatenated strings)