About: Netstring     Goto   Sponge   NotDistinct   Permalink

An Entity of Type : yago:WikicatDataSerializationFormats, within Data Space : dbpedia.demo.openlinksw.com associated with source document(s)
QRcode icon
http://dbpedia.demo.openlinksw.com/describe/?url=http%3A%2F%2Fdbpedia.org%2Fresource%2FNetstring&invfp=IFP_OFF&sas=SAME_AS_OFF

In computer programming, a netstring is a formatting method for byte strings that uses a declarative notation to indicate the size of the string. Netstrings store the byte length of the data that follows, making it easier to unambiguously pass text and byte data between programs that could be sensitive to values that could be interpreted as delimiters or terminators (such as a null character). For example, the text "hello world!" encodes as: <31 32 3a 68 65 6c 6c 6f 20 77 6f 72 6c 64 21 2c> i.e. 12:hello world!, And an empty string as: <30 3a 2c> i.e. 0:, 17:5:hello,6:world!,,

AttributesValues
rdf:type
rdfs:label
  • Netstring (en)
rdfs:comment
  • In computer programming, a netstring is a formatting method for byte strings that uses a declarative notation to indicate the size of the string. Netstrings store the byte length of the data that follows, making it easier to unambiguously pass text and byte data between programs that could be sensitive to values that could be interpreted as delimiters or terminators (such as a null character). For example, the text "hello world!" encodes as: <31 32 3a 68 65 6c 6c 6f 20 77 6f 72 6c 64 21 2c> i.e. 12:hello world!, And an empty string as: <30 3a 2c> i.e. 0:, 17:5:hello,6:world!,, (en)
dcterms:subject
Wikipage page ID
Wikipage revision ID
Link from a Wikipage to another Wikipage
Link from a Wikipage to an external page
sameAs
dbp:wikiPageUsesTemplate
has abstract
  • In computer programming, a netstring is a formatting method for byte strings that uses a declarative notation to indicate the size of the string. Netstrings store the byte length of the data that follows, making it easier to unambiguously pass text and byte data between programs that could be sensitive to values that could be interpreted as delimiters or terminators (such as a null character). The format consists of the string's length written using ASCII digits, followed by a colon, the byte data, and a comma. "Length" in this context means "number of 8-bit units", so if the string is, for example, encoded using UTF-8, this may or may not be identical to the number of textual characters that are present in the string. For example, the text "hello world!" encodes as: <31 32 3a 68 65 6c 6c 6f 20 77 6f 72 6c 64 21 2c> i.e. 12:hello world!, And an empty string as: <30 3a 2c> i.e. 0:, The comma makes it slightly simpler for humans to read netstrings that are used as adjacent records, and provides weak verification of correct parsing.Note that without the comma, the format mirrors how Bencode encodes strings. The length is written without leading zeroes. Empty string is the only netstring that begins with zero.There is exactly one legal netstring encoding for any byte string. Since the format is easy to generate and to parse, it is easy to support by programs written in different programming languages. In practice, netstrings are often used to simplify exchange of bytestrings, or lists of bytestrings.For example, see its use in the Simple Common Gateway Interface (SCGI) and the Quick Mail Queuing Protocol (QMQP) . Netstrings avoid complications that arise in trying to embed arbitrary data in delimited formats. For example, XML may not contain certain byte values and requires a nontrivial combination of escaping and delimiting, while generating multipart MIME messages involves choosing a delimiter that must not clash with the content of the data. Netstrings can be stored recursively. The result of encoding a sequence of strings is a single string. Rewriting the above "hello world!" example to instead be a sequence of two netstrings, itself encoded as a single netstring, gives the following: 17:5:hello,6:world!,, Parsing such a nested netstring is an example of duck typing, since the contained string ("5:hello,6:world!,") is both a string and a sequence of netstrings. Its effective type is determined by how the application chooses to interpret it, not by any explicit type declaration required by the netstring specification.In general, there are 3 ways that a program expecting a netstring may choose to interpret its contents: * As human-readable text with no further automatic processing * As encapsulated data in some pre-arranged fixed data serialization format (such as the binary contents of a C or C++ struct) * As encapsulated metadata and data, using a tagged union convention to describe the types of nested netstrings, thereby establishing a self-describing hierarchical data serialization format. ("Tagged netstrings" and Bencode can be seen as extensions of netstring that support similar self-describing hierarchical formats) Note that since netstrings pose no limitations on the contents of the data they store, netstrings can not be embedded verbatim in most delimited formats without the possibility of interfering with the delimiting of the containing format. In the context of network programming it is potentially useful that the receiving program is informed of the size of the data that follows, as it can allocate exactly enough memory, avoid the need for reallocation to accommodate more data, and preemptively reject data that would exceed size limits. (en)
gold:hypernym
prov:wasDerivedFrom
page length (characters) of wiki page
foaf:isPrimaryTopicOf
is Link from a Wikipage to another Wikipage of
is Wikipage redirect of
is foaf:primaryTopic of
Faceted Search & Find service v1.17_git139 as of Feb 29 2024


Alternative Linked Data Documents: ODE     Content Formats:   [cxml] [csv]     RDF   [text] [turtle] [ld+json] [rdf+json] [rdf+xml]     ODATA   [atom+xml] [odata+json]     Microdata   [microdata+json] [html]    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 08.03.3330 as of Mar 19 2024, on Linux (x86_64-generic-linux-glibc212), Single-Server Edition (378 GB total memory, 58 GB memory in use)
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2024 OpenLink Software