<commit_before>// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! Generate and parse UUIDs
//!
//! Provides support for Universally Unique Identifiers (UUIDs). A UUID is a
//! unique 128-bit number, stored as 16 octets.  UUIDs are used to  assign unique
//! identifiers to entities without requiring a central allocating authority.
//!
//! They are particularly useful in distributed systems, though can be used in
//! disparate areas, such as databases and network protocols.  Typically a UUID is
//! displayed in a readable string form as a sequence of hexadecimal digits,
//! separated into groups by hyphens.
//!
//! The uniqueness property is not strictly guaranteed, however for all practical
//! purposes, it can be assumed that an unintentional collision would be extremely
//! unlikely.
//!
//! # Examples
//!
//! To create a new random (V4) UUID and print it out in hexadecimal form:
//!
//! ```rust
//! use uuid::Uuid;
//!
//! fn main() {
//!     let uuid1 = Uuid::new_v4();
//!     println!("{}", uuid1.to_string());
//! }
//! ```
//!
//! # Strings
//!
//! Examples of string representations:
//!
//! * simple: `936DA01F9ABD4d9d80C702AF85C822A8`
//! * hyphenated: `550e8400-e29b-41d4-a716-446655440000`
//! * urn: `urn:uuid:F9168C5E-CEB2-4faa-B6BF-329BF39FA1E4`
//!
//! # References
//!
//! * [Wikipedia: Universally Unique Identifier](
//!     http://en.wikipedia.org/wiki/Universally_unique_identifier)
//! * [RFC4122: A Universally Unique IDentifier (UUID) URN Namespace](
//!     http://tools.ietf.org/html/rfc4122)

#![crate_name = "uuid"]
#![experimental]
#![crate_type = "rlib"]
#![crate_type = "dylib"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
       html_favicon_url = "http://www.rust-lang.org/favicon.ico")]

#![feature(default_type_params)]

// test harness access
#[cfg(test)]
extern crate test;
extern crate serialize;

use std::char::Char;
use std::default::Default;
use std::fmt;
use std::str::FromStr;
use std::hash;
use std::mem::{transmute,transmute_copy};
use std::num::{FromStrRadix, Int};
use std::rand;
use std::rand::Rng;
use std::slice;

use serialize::{Encoder, Encodable, Decoder, Decodable};

/// A 128-bit (16 byte) buffer containing the ID
pub type UuidBytes = [u8, ..16];

/// The version of the UUID, denoting the generating algorithm
#[deriving(PartialEq,Copy)]
pub enum UuidVersion {
    /// Version 1: MAC address
    Mac    = 1,<commit_msg>Add the root url to the docs<commit_after>// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! Generate and parse UUIDs
//!
//! Provides support for Universally Unique Identifiers (UUIDs). A UUID is a
//! unique 128-bit number, stored as 16 octets.  UUIDs are used to  assign unique
//! identifiers to entities without requiring a central allocating authority.
//!
//! They are particularly useful in distributed systems, though can be used in
//! disparate areas, such as databases and network protocols.  Typically a UUID is
//! displayed in a readable string form as a sequence of hexadecimal digits,
//! separated into groups by hyphens.
//!
//! The uniqueness property is not strictly guaranteed, however for all practical
//! purposes, it can be assumed that an unintentional collision would be extremely
//! unlikely.
//!
//! # Examples
//!
//! To create a new random (V4) UUID and print it out in hexadecimal form:
//!
//! ```rust
//! use uuid::Uuid;
//!
//! fn main() {
//!     let uuid1 = Uuid::new_v4();
//!     println!("{}", uuid1.to_string());
//! }
//! ```
//!
//! # Strings
//!
//! Examples of string representations:
//!
//! * simple: `936DA01F9ABD4d9d80C702AF85C822A8`
//! * hyphenated: `550e8400-e29b-41d4-a716-446655440000`
//! * urn: `urn:uuid:F9168C5E-CEB2-4faa-B6BF-329BF39FA1E4`
//!
//! # References
//!
//! * [Wikipedia: Universally Unique Identifier](
//!     http://en.wikipedia.org/wiki/Universally_unique_identifier)
//! * [RFC4122: A Universally Unique IDentifier (UUID) URN Namespace](
//!     http://tools.ietf.org/html/rfc4122)

#![crate_name = "uuid"]
#![experimental]
#![crate_type = "rlib"]
#![crate_type = "dylib"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
       html_favicon_url = "http://www.rust-lang.org/favicon.ico",
       html_root_url = "http://doc.rust-lang.org/uuid/")]

#![feature(default_type_params)]

// test harness access
#[cfg(test)]
extern crate test;
extern crate serialize;

use std::char::Char;
use std::default::Default;
use std::fmt;
use std::str::FromStr;
use std::hash;
use std::mem::{transmute,transmute_copy};
use std::num::{FromStrRadix, Int};
use std::rand;
use std::rand::Rng;
use std::slice;

use serialize::{Encoder, Encodable, Decoder, Decodable};

/// A 128-bit (16 byte) buffer containing the ID
pub type UuidBytes = [u8, ..16];

/// The version of the UUID, denoting the generating algorithm
#[deriving(PartialEq,Copy)]
pub enum UuidVersion {
    /// Version 1: MAC address
    Mac    = 1,
{'fraction_non_alphanumeric': 0.15687629578438148, 'fraction_numerical': 0.036973047684865236, 'mean_word_length': 3.760690789473684, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3977868', 'n_tokens_mistral': 2092, 'n_tokens_neox': 1882, 'n_words': 583}