diff options
Diffstat (limited to 'src/string_bytes.h')
-rw-r--r-- | src/string_bytes.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/string_bytes.h b/src/string_bytes.h index 05d9277d0e..8071a494ae 100644 --- a/src/string_bytes.h +++ b/src/string_bytes.h @@ -36,6 +36,11 @@ using v8::Value; class StringBytes { public: + // Does the string match the encoding? Quick but non-exhaustive. + // Example: a HEX string must have a length that's a multiple of two. + // FIXME(bnoordhuis) IsMaybeValidString()? Naming things is hard... + static bool IsValidString(Handle<String> string, enum encoding enc); + // Fast, but can be 2 bytes oversized for Base64, and // as much as triple UTF-8 strings <= 65536 chars in length static size_t StorageSize(Handle<Value> val, enum encoding enc); |