MediaWiki API result

This is the HTML representation of the JSON format. HTML is good for debugging, but is unsuitable for application use.

Specify the format parameter to change the output format. To see the non-HTML representation of the JSON format, set format=json.

See the complete documentation, or the API help for more information.

{
    "batchcomplete": "",
    "continue": {
        "gapcontinue": "TEmulVt",
        "continue": "gapcontinue||"
    },
    "warnings": {
        "main": {
            "*": "Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
        },
        "revisions": {
            "*": "Because \"rvslots\" was not specified, a legacy format has been used for the output. This format is deprecated, and in the future the new format will always be used."
        }
    },
    "query": {
        "pages": {
            "1786": {
                "pageid": 1786,
                "ns": 0,
                "title": "SHA1",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "[[Main_Page | Main page]] -> [[ICS_Components_Reference | ICS component reference]] \n\n== Overview ==\n{|\n| '''unit''' |||| OverbyteIcsSha1.pas\n|-\n| '''inheritance''' |||| none\n|}\n\nThis unit implements the SHA1 hash algorithm. This algorithm is considered to be insecure and should not be used anymore if possible. \nImproved descendants are SHA256, SHA384 or SHA512. Implementations of these can be found as class THashSHA2 in System.Hash.pas unit\nin Delphi versions from 10.0 Seattle onwards.\n\n== Functions ==\n\n{| \n| width=\"90\" valign=\"top\" | [[TName.SHA1Reset | SHA1Reset]] |||| Resets the hash algorithm's context\n|- \n| valign=\"top\" | [[TName.SHA1Input | SHA1Input]] |||| Calculates a hash sum over some chunk of data\n|}\n\n== How to ==\n\n{{Components_Footer}}"
                    }
                ]
            },
            "1378": {
                "pageid": 1378,
                "ns": 0,
                "title": "Sending and receiving data",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "[[Main_Page | Main page]] -> [[FAQ]] -> [[Sending and receiving data]]\n\n== General ==\n\nThere are several ways to transfer data. No matter if it is a file, an image, textual or raw data, it is all the same. What is needed is a common language between the data sender and the data receiver, in order for each to understand the other. This language defines a format. Formatting data is a way to \"shape\" it, describing its beginning and its end, in order for the receiver to know where data starts and ends.\n\n<!--\nWe use the term ''binary data'' not to make a difference to ''ASCII'' or human readable data, but for data that has an unpredictable content, meaning we cannot use  line mode just like that because whatever combination of characters you choose it ''could'' be in the data stream itself.\n\n== Solutions ==\n-->\n\nMany formats are of course possible, mainly depending upon the kind of data itself. Basically, we can consider that we have two kinds of data :\n* predictable data content\n* unpredictable data content\n\nIn the first case, we know what kind of content the data contains - ie the byte set that can be used is known (byte values from 32 to 127, for example). In the other case, the data content is not known - ie the byte set can be any possible byte value (from 0 to 255). This major difference will mostly determine the format of the data to be exchanged, defining then the protocol.\n\nConcerning Predictable Data Content, as the content values are known by advance - a subset of the 256 possible byte values, it is possible to know which byte values '''cannot''' be part of the data. This hint let us the possibility to create a delimiter made of one or more of these \"extra data\" byte values. This delimiter, sent after data, may then help us to know where data ends. This mode where a delimiter is placed at the end of data is named LineMode.\n\nConcerning Unpredictable Data Content, as the content values are never known by advance - byte set values starts at 0 and ends at 255, if we plan to send several data packet (for example several records) at once, then we have to tell the receiver the size of the data we're going to send for each packet. This mode to \"format\" data packet by prefixing it with its size is call PacketMode.\n\nAnd if we plan to send at the same time some Predictable Data Content and some Unpredictable Data Content, we can then imagine a combination of both mode.\n\n[[TWSocket]] has the ability to help you in implementing such a protocol. It is able to manage data using [[TWSocket.LineMode | LineMode]] and PacketMode (which is Non-LineMode).\n\n== Line mode ==\n\nLine mode is the most widely used, specially with ''ascii'' based protocols. But there are many protocols where line mode is used with unpredictable data. In that case that data has to converted into a specific range of bytes. The most used encoding mechanism are described here.\n\n=== Base-64 ===\n\n''Base64'' is an encoding process using a 64 letter alphabet where each letter representing 6 bits in the input stream. It is described in RFC [http://rfc.net/rfc2045.html#p24 2045]. All encoding and decoding procedures can be found in unit MimeUtil. The encoded data is about 33 percent larger and not human readable. Every character not used in the Base64 alphabet can be used as control character, including line end.\n\n=== ASCII-hex ===\n\n''ASCII-hex'' is used in many protocols. Every character is converted into his hexadecimal equivalent and sent as such. For example the string '123' is sent as '313233'. The encoded data is twice as long and difficult human readable. Every character except 0..9, A..F can be used as control character, including line end.\n\n=== Escaping ===\n\nEscaping is very often used. Control characters including line end has to be chosen in a way they are as less as possible in the original data. The principle is to precede the control characters with an escape character and replace them by other characters. Very often a NULL character is escaped as well. Most of the time the encoded data is only a little longer than original and good human readable.\n\n=== Quoted-Printable ===\n    \nThe Quoted-Printable encoding as specified in RFC [http://RFC.net/rfc1521.html#p18 1521] is intended to represent data which is largely human readable. It encodes certain byte ranges into their hexadecimal presentation. The encoded data remains good human readable. Procedures to encode and decode Quoted-Printable can be found in unit MimeUtil. Every encoded character can be used as control character, including line end.\n\n<!--\nThe Quoted-Printable encoding as specified in RFC [http://RFC.net/rfc1521.html#p18 1521] is intended to represent data that largely consists of bytes that correspond to printable characters in the ASCII character set. It encodes the data in such a way that the resulting bytes are unlikely to be modified by mail transport. If the data being encoded are mostly ASCII text, the encoded form of the data remains largely recognizable by humans. Procedures to encode and decode Quoted-Printable can be found in unit MimeUtil.\n-->\n\n== Packet mode ==\n\nPacket mode is also very widely used and most of the time designed for a specific protocol. In packet mode the data has a specific structure which eventually can be different depending on the type of packet even within the same protocol. The most universal ones are explained here.\n\n=== Header ===\n\nA very often used technique is to precede the data with a header. Presides other control information this header has a field containing the length of the data.\n\nThe length field is 1, 2 or 4 bytes long. Note that it is common habitude in communications to represent numbers in [[Endian | Big Endian]] format while Intel CPU use by design [[Endian | Little Endian]] format.\n\nLess used but also a very good technique is to represent the length field in hexadecimal format of 2, 4 or 8 bytes. Advantage is that it is human readable.\n\n=== Fixed length data ===\n\nFixed length data is where all packets of the same type have the same structure and length. Mostly the type of the structure is indicated in a field somewhere at the beginning. If such a structure contains a data field of variable length then eater the data is padded or its length is indicated in a field in the structure.\n\n== Mixed mode ==\n\n[[TWSocket]] has the ability to implement a mixed mode protocol by switching [[TWSocket.LineMode | LineMode]] during negotiation.\n\n=== Example ===\n\n* ''A'' want to send data, so he tell it to ''B'' during negotiation, with ''ascii'' commands using [[TWSocket.LineMode | LineMode]], including the size.\n* After receiving that information, ''B'' switch [[TWSocket.LineMode | LineMode]] off then tell it to ''A''.\n* When ''A'' receive this confirmation it start sending exact what has negotiated.\n* When ''B'' has received it all, then he switch [[TWSocket.LineMode | LineMode]] back on then tell it to ''A''.\n* After receiving that information both are again in negotiation phase.\n\n== Conclusion ==\n\nDifficult to explain something :)\n\n\n[[User:Wilfried|Wilfried]] 20:18, 21 February 2006 (CET)"
                    }
                ]
            }
        }
    }
}