<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->

<phpdoc:classref xml:id="class.mongodb-bson-binary" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">

 <title>The MongoDB\BSON\Binary class</title>
 <titleabbrev>MongoDB\BSON\Binary</titleabbrev>

 <partintro>

<!-- {{{ MongoDB\BSON\Binary intro -->
  <section xml:id="mongodb-bson-binary.intro">
   &reftitle.intro;
   <para>
    BSON type for binary data (i.e. array of bytes). Binary values also have a
    subtype, which is used to indicate what kind of data is in the byte array.
    Subtypes from zero to 127 are predefined or reserved. Subtypes from 128-255
    are user-defined.
   </para>
  </section>
<!-- }}} -->

  <section xml:id="mongodb-bson-binary.synopsis">
   &reftitle.classsynopsis;

<!-- {{{ Synopsis -->
   <classsynopsis>
    <ooclass><classname>MongoDB\BSON\Binary</classname></ooclass>

<!-- {{{ Class synopsis -->
    <classsynopsisinfo>
     <modifier>final</modifier>
     <ooclass>
      <classname>MongoDB\BSON\Binary</classname>
     </ooclass>

     <oointerface>
      <interfacename>MongoDB\BSON\BinaryInterface</interfacename>
     </oointerface>

     <oointerface>
      <interfacename>MongoDB\BSON\Type</interfacename>
     </oointerface>

     <oointerface>
      <interfacename>Serializable</interfacename>
     </oointerface>

     <oointerface>
      <interfacename>JsonSerializable</interfacename>
     </oointerface>

     <oointerface>
      <interfacename>Stringable</interfacename>
     </oointerface>
    </classsynopsisinfo>
<!-- }}} -->
    <classsynopsisinfo role="comment">&Constants;</classsynopsisinfo>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="mongodb-bson-binary.constants.type-generic">MongoDB\BSON\Binary::TYPE_GENERIC</varname>
     <initializer>0</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="mongodb-bson-binary.constants.type-function">MongoDB\BSON\Binary::TYPE_FUNCTION</varname>
     <initializer>1</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="mongodb-bson-binary.constants.type-old-binary">MongoDB\BSON\Binary::TYPE_OLD_BINARY</varname>
     <initializer>2</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="mongodb-bson-binary.constants.type-old-uuid">MongoDB\BSON\Binary::TYPE_OLD_UUID</varname>
     <initializer>3</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="mongodb-bson-binary.constants.type-uuid">MongoDB\BSON\Binary::TYPE_UUID</varname>
     <initializer>4</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="mongodb-bson-binary.constants.type-md5">MongoDB\BSON\Binary::TYPE_MD5</varname>
     <initializer>5</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="mongodb-bson-binary.constants.type-encrypted">MongoDB\BSON\Binary::TYPE_ENCRYPTED</varname>
     <initializer>6</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="mongodb-bson-binary.constants.type-column">MongoDB\BSON\Binary::TYPE_COLUMN</varname>
     <initializer>7</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="mongodb-bson-binary.constants.type-sensitive">MongoDB\BSON\Binary::TYPE_SENSITIVE</varname>
     <initializer>8</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="mongodb-bson-binary.constants.type-user-defined">MongoDB\BSON\Binary::TYPE_USER_DEFINED</varname>
     <initializer>128</initializer>
    </fieldsynopsis>

    <classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
    <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.mongodb-bson-binary')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[not(@role='procedural')])" />
   </classsynopsis>
<!-- }}} -->

  </section>

<!-- {{{ MongoDB\BSON\Binary constants -->
  <section xml:id="mongodb-bson-binary.constants">
   &reftitle.constants;
   <variablelist>

    <varlistentry xml:id="mongodb-bson-binary.constants.type-generic">
     <term><constant>MongoDB\BSON\Binary::TYPE_GENERIC</constant></term>
     <listitem>
      <para>Generic binary data.</para>
     </listitem>
    </varlistentry>

    <varlistentry xml:id="mongodb-bson-binary.constants.type-function">
     <term><constant>MongoDB\BSON\Binary::TYPE_FUNCTION</constant></term>
     <listitem>
      <para>Function.</para>
     </listitem>
    </varlistentry>

    <varlistentry xml:id="mongodb-bson-binary.constants.type-old-binary">
     <term><constant>MongoDB\BSON\Binary::TYPE_OLD_BINARY</constant></term>
     <listitem>
      <para>Generic binary data (deprecated in favor of <constant>MongoDB\BSON\Binary::TYPE_GENERIC</constant>).</para>
     </listitem>
    </varlistentry>

    <varlistentry xml:id="mongodb-bson-binary.constants.type-old-uuid">
     <term><constant>MongoDB\BSON\Binary::TYPE_OLD_UUID</constant></term>
     <listitem>
      <para>Universally unique identifier (deprecated in favor of <constant>MongoDB\BSON\Binary::TYPE_UUID</constant>). When using this type, the Binary&apos;s data should be 16 bytes in length.</para>
      <para>Historically, other drivers encoded values with this type based on their language conventions (e.g. varying endianness), which makes it non-portable. The PHP driver applies no special handling for encoding or decoding data with this type.</para>
     </listitem>
    </varlistentry>

    <varlistentry xml:id="mongodb-bson-binary.constants.type-uuid">
     <term><constant>MongoDB\BSON\Binary::TYPE_UUID</constant></term>
     <listitem>
      <para>Universally unique identifier. When using this type, the Binary&apos;s data should be 16 bytes in length and encoded according to <link xlink:href="&url.rfc;4122">RFC 4122</link>.</para>
     </listitem>
    </varlistentry>

    <varlistentry xml:id="mongodb-bson-binary.constants.type-md5">
     <term><constant>MongoDB\BSON\Binary::TYPE_MD5</constant></term>
     <listitem>
      <para>MD5 hash. When using this type, the Binary&apos;s data should be 16 bytes in length.</para>
     </listitem>
    </varlistentry>

    <varlistentry xml:id="mongodb-bson-binary.constants.type-encrypted">
     <term><constant>MongoDB\BSON\Binary::TYPE_ENCRYPTED</constant></term>
     <listitem>
      <para>Encrypted value. This subtype is used for client-side encryption.</para>
     </listitem>
    </varlistentry>

    <varlistentry xml:id="mongodb-bson-binary.constants.type-column">
     <term><constant>MongoDB\BSON\Binary::TYPE_COLUMN</constant></term>
     <listitem>
      <para>Column data. This subtype is used for time-series collections.</para>
     </listitem>
    </varlistentry>

    <varlistentry xml:id="mongodb-bson-binary.constants.type-sensitive">
     <term><constant>MongoDB\BSON\Binary::TYPE_SENSITIVE</constant></term>
     <listitem>
      <para>
       Sensitive data. This subtype is used for sensitive data that should be
       excluded from server-side logging when possible.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry xml:id="mongodb-bson-binary.constants.type-user-defined">
     <term><constant>MongoDB\BSON\Binary::TYPE_USER_DEFINED</constant></term>
     <listitem>
      <para>User-defined type. While types between 0 and 127 are predefined or reserved, types between 128 and 255 are user-defined and may be used for anything.</para>
     </listitem>
    </varlistentry>

   </variablelist>
  </section>
<!-- }}} -->

  <section role="changelog">
   &reftitle.changelog;
   <para>
    <informaltable>
     <tgroup cols="2">
      <thead>
       <row>
        <entry>&Version;</entry>
        <entry>&Description;</entry>
       </row>
      </thead>
      <tbody>
       <row>
        <entry>PECL mongodb 1.17.0</entry>
        <entry>
         Added <constant>MongoDB\BSON\Binary::TYPE_SENSITIVE</constant>.
        </entry>
       </row>
       <row>
        <entry>PECL mongodb 1.12.0</entry>
        <entry>
         <para>
          Implements <interfacename>Stringable</interfacename> for PHP 8.0+.
         </para>
         <para>
          Added <constant>MongoDB\BSON\Binary::TYPE_COLUMN</constant>.
         </para>
        </entry>
       </row>
       <row>
        <entry>PECL mongodb 1.7.0</entry>
        <entry>
         Added <constant>MongoDB\BSON\Binary::TYPE_ENCRYPTED</constant>.
        </entry>
       </row>
       <row>
        <entry>PECL mongodb 1.3.0</entry>
        <entry>
         Implements <interfacename>MongoDB\BSON\BinaryInterface</interfacename>.
        </entry>
       </row>
       <row>
        <entry>PECL mongodb 1.2.0</entry>
        <entry>
         Implements <interfacename>Serializable</interfacename> and
         <interfacename>JsonSerializable</interfacename>.
        </entry>
       </row>
      </tbody>
     </tgroup>
    </informaltable>
   </para>
  </section>

 </partintro>

 &reference.mongodb.bson.entities.binary;

</phpdoc:classref>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
