{
    "content": [
        {
            "type": "text",
            "text": "# OSSP::uuid (perldoc)\n\n## NAME\n\nOSSP::uuid - OSSP uuid Perl Binding\n\n## DESCRIPTION\n\nOSSP uuid is a ISO-C:1999 application programming interface (API) and corresponding command line\ninterface (CLI) for the generation of DCE 1.1, ISO/IEC 11578:1996 and RFC 4122 compliant\n*Universally Unique Identifier* (UUID). It supports DCE 1.1 variant UUIDs of version 1 (time and\nnode based), version 3 (name based, MD5), version 4 (random number based) and version 5 (name\nbased, SHA-1). Additional API bindings are provided for the languages ISO-C++:1998, Perl:5 and\nPHP:4/5. Optional backward compatibility exists for the ISO-C DCE-1.1 and Perl Data::UUID APIs.\n\n## Sections\n\n- **NAME**\n- **DESCRIPTION**\n- **EXAMPLES**\n- **SEE ALSO** (1 subsections)\n- **HISTORY**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "OSSP::uuid",
        "section": "",
        "mode": "perldoc",
        "summary": "OSSP::uuid - OSSP uuid Perl Binding",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [
            "The following two examples create the version 3 UUID \"02d9e6d5-9467-382e-8f9b-9300a64ac3cd\",",
            "both via the OO-style and the C-style API. Error handling is omitted here for easier reading,",
            "but has to be added for production-quality code.",
            "#   TIE-style API (very high-level)",
            "use OSSP::uuid;",
            "tie my $uuid, 'OSSP::uuid::tie';",
            "$uuid = [ \"v1\" ];",
            "print \"UUIDs: $uuid, $uuid, $uuid\\n\";",
            "$uuid = [ \"v3\", \"ns:URL\", \"http://www.ossp.org/\" ];",
            "print \"UUIDs: $uuid, $uuid, $uuid\\n\";",
            "untie $uuid;",
            "#   OO-style API (high-level)",
            "use OSSP::uuid;",
            "my $uuid    = new OSSP::uuid;",
            "my $uuidns = new OSSP::uuid;",
            "$uuidns->load(\"ns:URL\");",
            "$uuid->make(\"v3\", $uuidns, \"http://www.ossp.org/\");",
            "undef $uuidns;",
            "my $str = $uuid->export(\"str\");",
            "undef $uuid;",
            "print \"$str\\n\";",
            "#   C-style API (low-level)",
            "use OSSP::uuid qw(:all);",
            "my $uuid;    uuidcreate($uuid);",
            "my $uuidns; uuidcreate($uuidns);",
            "uuidload($uuidns, \"ns:URL\");",
            "uuidmake($uuid, UUIDMAKEV3, $uuidns, \"http://www.ossp.org/\");",
            "uuiddestroy($uuidns);",
            "my $str; uuidexport($uuid, UUIDFMTSTR, $str, undef);",
            "uuiddestroy($uuid);",
            "print \"$str\\n\";"
        ],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 61,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 35,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 1,
                "subsections": [
                    {
                        "name": "uuid",
                        "lines": 1
                    }
                ]
            },
            {
                "name": "HISTORY",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "OSSP::uuid - OSSP uuid Perl Binding\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "OSSP uuid is a ISO-C:1999 application programming interface (API) and corresponding command line\ninterface (CLI) for the generation of DCE 1.1, ISO/IEC 11578:1996 and RFC 4122 compliant\n*Universally Unique Identifier* (UUID). It supports DCE 1.1 variant UUIDs of version 1 (time and\nnode based), version 3 (name based, MD5), version 4 (random number based) and version 5 (name\nbased, SHA-1). Additional API bindings are provided for the languages ISO-C++:1998, Perl:5 and\nPHP:4/5. Optional backward compatibility exists for the ISO-C DCE-1.1 and Perl Data::UUID APIs.\n\nOSSP::uuid is the Perl binding to the OSSP uuid API. Three variants are provided:\n\nTIE-STYLE API\nThe TIE-style API is a functionality-reduced wrapper around the OO-style API and intended for\nvery high-level convenience programming:\n\n\"use OSSP::uuid;\"\ntie\" my $uuid, 'OSSP::uuid::tie', $mode, ...;\"\n\"$uuid = [ $mode, ... ];\"\n\"print \"UUID=$uuid\\n\";\"\n\"untie $uuid;\"\n\nOO-STYLE API\nThe OO-style API is a wrapper around the C-style API and intended for high-level regular\nprogramming.\n\n\"use OSSP::uuid;\"\n\"my $uuid = \"new\" OSSP::uuid;\"\n\"$uuid->\"load\"($name);\"\n\"$uuid->\"make\"($mode, ...);\"\n\"$result = $uuid->\"isnil\"();\"\n\"$result = $uuid->\"compare\"($uuid2);\"\n\"$uuid->\"import\"($fmt, $dataptr);\"\n\"$dataptr = $uuid->\"export\"($fmt);\"\n\"[(]$str[, $rc)] = $uuid->\"error\"();\"\n\"$ver = $uuid->\"version\"();\"\n\"undef $uuid;\"\n\nAdditionally, the strings \"v1\", \"v3\", \"v4\", \"v5\" and \"mc\" can be used in $mode and the strings\n\"bin\", \"str\", and \"txt\" can be used for $fmt.\n\nC-STYLE API\nThe C-style API is a direct mapping of the OSSP uuid ISO-C API to Perl and is intended for\nlow-level programming. See uuid(3) for a description of the functions and their expected\narguments.\n\n\"use OSSP::uuid qw(:all);\"\n\"my $uuid; $rc = \"uuidcreate\"($uuid);\"\n\"$rc = \"uuidload\"($uuid, $name);\"\n\"$rc = \"uuidmake\"($uuid, $mode, ...);\"\n\"$rc = \"uuidisnil\"($uuid, $result);\"\n\"$rc = \"uuidcompare\"($uuid, $uuid2, $result);\"\n\"$rc = \"uuidimport\"($uuid, $fmt, $dataptr, $datalen);\"\n\"$rc = \"uuidexport\"($uuid, $fmt, $dataptr, $datalen);\"\n\"$str = \"uuiderror\"($rc);\"\n\"$ver = \"uuidversion\"();\"\n\"$rc = \"uuiddestroy\"($uuid);\"\n\nAdditionally, the following constants are exported for use in $rc, $mode, $fmt and $ver:\n\n\"UUIDVERSION\", \"UUIDLENBIN\", \"UUIDLENSTR\", \"UUIDRCOK\", \"UUIDRCARG\", \"UUIDRCMEM\",\n\"UUIDRCSYS\", \"UUIDRCINT\", \"UUIDRCIMP\", \"UUIDMAKEV1\", \"UUIDMAKEV3\", \"UUIDMAKEV4\",\n\"UUIDMAKEV5\", \"UUIDMAKEMC\", \"UUIDFMTBIN\", \"UUIDFMTSTR\", \"UUIDFMTSIV\", \"UUIDFMTTXT\".\n",
                "subsections": []
            },
            "EXAMPLES": {
                "content": "The following two examples create the version 3 UUID \"02d9e6d5-9467-382e-8f9b-9300a64ac3cd\",\nboth via the OO-style and the C-style API. Error handling is omitted here for easier reading,\nbut has to be added for production-quality code.\n\n#   TIE-style API (very high-level)\nuse OSSP::uuid;\ntie my $uuid, 'OSSP::uuid::tie';\n$uuid = [ \"v1\" ];\nprint \"UUIDs: $uuid, $uuid, $uuid\\n\";\n$uuid = [ \"v3\", \"ns:URL\", \"http://www.ossp.org/\" ];\nprint \"UUIDs: $uuid, $uuid, $uuid\\n\";\nuntie $uuid;\n\n#   OO-style API (high-level)\nuse OSSP::uuid;\nmy $uuid    = new OSSP::uuid;\nmy $uuidns = new OSSP::uuid;\n$uuidns->load(\"ns:URL\");\n$uuid->make(\"v3\", $uuidns, \"http://www.ossp.org/\");\nundef $uuidns;\nmy $str = $uuid->export(\"str\");\nundef $uuid;\nprint \"$str\\n\";\n\n#   C-style API (low-level)\nuse OSSP::uuid qw(:all);\nmy $uuid;    uuidcreate($uuid);\nmy $uuidns; uuidcreate($uuidns);\nuuidload($uuidns, \"ns:URL\");\nuuidmake($uuid, UUIDMAKEV3, $uuidns, \"http://www.ossp.org/\");\nuuiddestroy($uuidns);\nmy $str; uuidexport($uuid, UUIDFMTSTR, $str, undef);\nuuiddestroy($uuid);\nprint \"$str\\n\";\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "",
                "subsections": [
                    {
                        "name": "uuid",
                        "content": ""
                    }
                ]
            },
            "HISTORY": {
                "content": "The Perl binding OSSP::uuid to OSSP uuid was implemented in November 2004 by Ralf S. Engelschall\n<rse@engelschall.com>.\n",
                "subsections": []
            }
        }
    }
}