Showing preview only (1,076K chars total). Download the full file or copy to clipboard to get everything.
Repository: ramsey/uuid
Branch: 4.x
Commit: 39d47ce3362c
Files: 287
Total size: 1002.0 KB
Directory structure:
gitextract_l3omq1zh/
├── .editorconfig
├── .gitattributes
├── .github/
│ ├── CODEOWNERS
│ ├── ISSUE_TEMPLATE/
│ │ ├── Bug_Report.md
│ │ ├── Feature_Request.md
│ │ ├── Question.md
│ │ └── config.yml
│ ├── dependabot.yml
│ ├── pull_request_template.md
│ └── workflows/
│ ├── continuous-integration.yml
│ └── merge-me.yml
├── .gitignore
├── .readthedocs.yml
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── SECURITY.md
├── build/
│ ├── .gitignore
│ ├── cache/
│ │ └── .gitkeep
│ └── logs/
│ └── .gitkeep
├── captainhook.json
├── codecov.yml
├── composer.json
├── docs/
│ ├── .gitignore
│ ├── LICENSE
│ ├── Makefile
│ ├── README.md
│ ├── _static/
│ │ └── .gitkeep
│ ├── conf.py
│ ├── copyright.rst
│ ├── customize/
│ │ ├── calculators.rst
│ │ ├── factory.rst
│ │ ├── ordered-time-codec.rst
│ │ ├── timestamp-first-comb-codec.rst
│ │ └── validators.rst
│ ├── customize.rst
│ ├── database.rst
│ ├── faq.rst
│ ├── index.rst
│ ├── introduction.rst
│ ├── nonstandard/
│ │ ├── guid.rst
│ │ ├── other.rst
│ │ └── version6.rst
│ ├── nonstandard.rst
│ ├── quickstart.rst
│ ├── reference/
│ │ ├── calculators.rst
│ │ ├── exceptions.rst
│ │ ├── fields-fieldsinterface.rst
│ │ ├── guid-fields.rst
│ │ ├── guid-guid.rst
│ │ ├── helper.rst
│ │ ├── name-based-namespaces.rst
│ │ ├── nonstandard-fields.rst
│ │ ├── nonstandard-uuid.rst
│ │ ├── nonstandard-uuidv6.rst
│ │ ├── rfc4122-fieldsinterface.rst
│ │ ├── rfc4122-uuidinterface.rst
│ │ ├── rfc4122-uuidv1.rst
│ │ ├── rfc4122-uuidv2.rst
│ │ ├── rfc4122-uuidv3.rst
│ │ ├── rfc4122-uuidv4.rst
│ │ ├── rfc4122-uuidv5.rst
│ │ ├── rfc4122-uuidv6.rst
│ │ ├── rfc4122-uuidv7.rst
│ │ ├── rfc4122-uuidv8.rst
│ │ ├── types.rst
│ │ ├── uuid.rst
│ │ ├── uuidfactoryinterface.rst
│ │ ├── uuidinterface.rst
│ │ └── validators.rst
│ ├── reference.rst
│ ├── requirements.txt
│ ├── rfc4122/
│ │ ├── version1.rst
│ │ ├── version2.rst
│ │ ├── version3.rst
│ │ ├── version4.rst
│ │ ├── version5.rst
│ │ ├── version6.rst
│ │ ├── version7.rst
│ │ └── version8.rst
│ ├── rfc4122.rst
│ ├── testing.rst
│ ├── upgrading/
│ │ ├── 2-to-3.rst
│ │ └── 3-to-4.rst
│ └── upgrading.rst
├── phpbench.json
├── phpcs.xml.dist
├── phpstan.neon.dist
├── phpunit.xml.dist
├── resources/
│ └── vagrant/
│ ├── .gitignore
│ ├── README.md
│ ├── freebsd/
│ │ ├── README.md
│ │ └── Vagrantfile
│ ├── linux/
│ │ ├── README.md
│ │ └── Vagrantfile
│ └── windows/
│ ├── README.md
│ └── Vagrantfile
├── src/
│ ├── BinaryUtils.php
│ ├── Builder/
│ │ ├── BuilderCollection.php
│ │ ├── DefaultUuidBuilder.php
│ │ ├── DegradedUuidBuilder.php
│ │ ├── FallbackBuilder.php
│ │ └── UuidBuilderInterface.php
│ ├── Codec/
│ │ ├── CodecInterface.php
│ │ ├── GuidStringCodec.php
│ │ ├── OrderedTimeCodec.php
│ │ ├── StringCodec.php
│ │ ├── TimestampFirstCombCodec.php
│ │ └── TimestampLastCombCodec.php
│ ├── Converter/
│ │ ├── Number/
│ │ │ ├── BigNumberConverter.php
│ │ │ ├── DegradedNumberConverter.php
│ │ │ └── GenericNumberConverter.php
│ │ ├── NumberConverterInterface.php
│ │ ├── Time/
│ │ │ ├── BigNumberTimeConverter.php
│ │ │ ├── DegradedTimeConverter.php
│ │ │ ├── GenericTimeConverter.php
│ │ │ ├── PhpTimeConverter.php
│ │ │ └── UnixTimeConverter.php
│ │ └── TimeConverterInterface.php
│ ├── DegradedUuid.php
│ ├── DeprecatedUuidInterface.php
│ ├── DeprecatedUuidMethodsTrait.php
│ ├── Exception/
│ │ ├── BuilderNotFoundException.php
│ │ ├── DateTimeException.php
│ │ ├── DceSecurityException.php
│ │ ├── InvalidArgumentException.php
│ │ ├── InvalidBytesException.php
│ │ ├── InvalidUuidStringException.php
│ │ ├── NameException.php
│ │ ├── NodeException.php
│ │ ├── RandomSourceException.php
│ │ ├── TimeSourceException.php
│ │ ├── UnableToBuildUuidException.php
│ │ ├── UnsupportedOperationException.php
│ │ └── UuidExceptionInterface.php
│ ├── FeatureSet.php
│ ├── Fields/
│ │ ├── FieldsInterface.php
│ │ └── SerializableFieldsTrait.php
│ ├── Generator/
│ │ ├── CombGenerator.php
│ │ ├── DceSecurityGenerator.php
│ │ ├── DceSecurityGeneratorInterface.php
│ │ ├── DefaultNameGenerator.php
│ │ ├── DefaultTimeGenerator.php
│ │ ├── NameGeneratorFactory.php
│ │ ├── NameGeneratorInterface.php
│ │ ├── PeclUuidNameGenerator.php
│ │ ├── PeclUuidRandomGenerator.php
│ │ ├── PeclUuidTimeGenerator.php
│ │ ├── RandomBytesGenerator.php
│ │ ├── RandomGeneratorFactory.php
│ │ ├── RandomGeneratorInterface.php
│ │ ├── RandomLibAdapter.php
│ │ ├── TimeGeneratorFactory.php
│ │ ├── TimeGeneratorInterface.php
│ │ └── UnixTimeGenerator.php
│ ├── Guid/
│ │ ├── Fields.php
│ │ ├── Guid.php
│ │ └── GuidBuilder.php
│ ├── Lazy/
│ │ └── LazyUuidFromString.php
│ ├── Math/
│ │ ├── BrickMathCalculator.php
│ │ ├── CalculatorInterface.php
│ │ └── RoundingMode.php
│ ├── Nonstandard/
│ │ ├── Fields.php
│ │ ├── Uuid.php
│ │ ├── UuidBuilder.php
│ │ └── UuidV6.php
│ ├── Provider/
│ │ ├── Dce/
│ │ │ └── SystemDceSecurityProvider.php
│ │ ├── DceSecurityProviderInterface.php
│ │ ├── Node/
│ │ │ ├── FallbackNodeProvider.php
│ │ │ ├── NodeProviderCollection.php
│ │ │ ├── RandomNodeProvider.php
│ │ │ ├── StaticNodeProvider.php
│ │ │ └── SystemNodeProvider.php
│ │ ├── NodeProviderInterface.php
│ │ ├── Time/
│ │ │ ├── FixedTimeProvider.php
│ │ │ └── SystemTimeProvider.php
│ │ └── TimeProviderInterface.php
│ ├── Rfc4122/
│ │ ├── Fields.php
│ │ ├── FieldsInterface.php
│ │ ├── MaxTrait.php
│ │ ├── MaxUuid.php
│ │ ├── NilTrait.php
│ │ ├── NilUuid.php
│ │ ├── TimeTrait.php
│ │ ├── UuidBuilder.php
│ │ ├── UuidInterface.php
│ │ ├── UuidV1.php
│ │ ├── UuidV2.php
│ │ ├── UuidV3.php
│ │ ├── UuidV4.php
│ │ ├── UuidV5.php
│ │ ├── UuidV6.php
│ │ ├── UuidV7.php
│ │ ├── UuidV8.php
│ │ ├── Validator.php
│ │ ├── VariantTrait.php
│ │ └── VersionTrait.php
│ ├── Type/
│ │ ├── Decimal.php
│ │ ├── Hexadecimal.php
│ │ ├── Integer.php
│ │ ├── NumberInterface.php
│ │ ├── Time.php
│ │ └── TypeInterface.php
│ ├── Uuid.php
│ ├── UuidFactory.php
│ ├── UuidFactoryInterface.php
│ ├── UuidInterface.php
│ ├── Validator/
│ │ ├── GenericValidator.php
│ │ └── ValidatorInterface.php
│ └── functions.php
└── tests/
├── BinaryUtilsTest.php
├── Builder/
│ ├── DefaultUuidBuilderTest.php
│ └── FallbackBuilderTest.php
├── Codec/
│ ├── GuidStringCodecTest.php
│ ├── OrderedTimeCodecTest.php
│ └── StringCodecTest.php
├── Converter/
│ ├── Number/
│ │ ├── BigNumberConverterTest.php
│ │ └── GenericNumberConverterTest.php
│ └── Time/
│ ├── BigNumberTimeConverterTest.php
│ ├── GenericTimeConverterTest.php
│ ├── PhpTimeConverterTest.php
│ └── UnixTimeConverterTest.php
├── DeprecatedUuidMethodsTraitTest.php
├── Encoder/
│ ├── TimestampFirstCombCodecTest.php
│ └── TimestampLastCombCodecTest.php
├── ExpectedBehaviorTest.php
├── FeatureSetTest.php
├── FunctionsTest.php
├── Generator/
│ ├── CombGeneratorTest.php
│ ├── DceSecurityGeneratorTest.php
│ ├── DefaultNameGeneratorTest.php
│ ├── DefaultTimeGeneratorTest.php
│ ├── NameGeneratorFactoryTest.php
│ ├── PeclUuidNameGeneratorTest.php
│ ├── PeclUuidRandomGeneratorTest.php
│ ├── PeclUuidTimeGeneratorTest.php
│ ├── RandomBytesGeneratorTest.php
│ ├── RandomGeneratorFactoryTest.php
│ ├── RandomLibAdapterTest.php
│ ├── TimeGeneratorFactoryTest.php
│ └── UnixTimeGeneratorTest.php
├── Guid/
│ ├── FieldsTest.php
│ └── GuidBuilderTest.php
├── Math/
│ └── BrickMathCalculatorTest.php
├── Nonstandard/
│ ├── FieldsTest.php
│ ├── UuidBuilderTest.php
│ └── UuidV6Test.php
├── Provider/
│ ├── Dce/
│ │ └── SystemDceSecurityProviderTest.php
│ ├── Node/
│ │ ├── FallbackNodeProviderTest.php
│ │ ├── RandomNodeProviderTest.php
│ │ ├── StaticNodeProviderTest.php
│ │ └── SystemNodeProviderTest.php
│ └── Time/
│ ├── FixedTimeProviderTest.php
│ └── SystemTimeProviderTest.php
├── Rfc4122/
│ ├── FieldsTest.php
│ ├── UuidBuilderTest.php
│ ├── UuidV1Test.php
│ ├── UuidV2Test.php
│ ├── UuidV3Test.php
│ ├── UuidV4Test.php
│ ├── UuidV5Test.php
│ ├── UuidV6Test.php
│ ├── UuidV7Test.php
│ ├── UuidV8Test.php
│ ├── ValidatorTest.php
│ └── VariantTraitTest.php
├── TestCase.php
├── Type/
│ ├── DecimalTest.php
│ ├── HexadecimalTest.php
│ ├── IntegerTest.php
│ └── TimeTest.php
├── UuidFactoryTest.php
├── UuidTest.php
├── Validator/
│ └── GenericValidatorTest.php
├── benchmark/
│ ├── GuidConversionBench.php
│ ├── NonLazyUuidConversionBench.php
│ ├── UuidFieldExtractionBench.php
│ ├── UuidGenerationBench.php
│ ├── UuidSerializationBench.php
│ └── UuidStringConversionBench.php
├── bootstrap.php
└── static-analysis/
├── UuidIsImmutable.php
├── UuidIsNeverEmpty.php
├── ValidUuidIsNonEmpty.php
└── stubs.php
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
# EditorConfig http://EditorConfig.org
# top-most EditorConfig file
root = true
# This applies to all files
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
indent_style = space
indent_size = 4
[*.{yml,yaml}]
indent_size = 2
================================================
FILE: .gitattributes
================================================
/.allowed-licenses export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.github/ export-ignore
/.gitignore export-ignore
/.readthedocs.yml export-ignore
/bin/ export-ignore
/build/ export-ignore
/captainhook.json export-ignore
/CHANGELOG.md export-ignore
/composer.lock export-ignore
/codecov.yml export-ignore
/CODE_OF_CONDUCT.md export-ignore
/CONTRIBUTING.md export-ignore
/conventional-commits.json export-ignore
/docs/ export-ignore
/phpbench.json export-ignore
/phpcs.xml.dist export-ignore
/phpstan-tests.neon export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
/resources/ export-ignore
/SECURITY.md export-ignore
/tests/ export-ignore
================================================
FILE: .github/CODEOWNERS
================================================
* @ramsey
================================================
FILE: .github/ISSUE_TEMPLATE/Bug_Report.md
================================================
---
name: Bug Report
about: Create a bug report to help us improve
labels: bug
assignees:
---
<!--- Provide a general summary of the issue you're having in the title above. -->
## Description
<!-- Provide a short and clear description of the bug. -->
## Steps to reproduce
<!--
Provide steps to reproduce the behavior you are experiencing. Please try to keep
this as short as possible. If able, create a reproducible script outside of any
framework you are using. This will help us to quickly debug the issue.
-->
1. Step one...
2. Step two...
3. Step three...
## Expected behavior
<!-- Provide a short and clear description of what you expect to happen. -->
## Screenshots or output
<!-- If applicable, add screenshots or program output to help explain your problem. -->
## Environment details
<!-- Provide details about the system where you're using this package. -->
- version of this package: *e.g. 1.0.0, 1.0.1, 1.1.0*
- PHP version: *e.g. 7.3.16, 7.4.4*
- OS: *e.g. Windows 10, Linux (Ubuntu 18.04.1), macOS Catalina (10.15.3)*
## Additional context
<!-- Provide any additional context that may help us debug the problem. -->
================================================
FILE: .github/ISSUE_TEMPLATE/Feature_Request.md
================================================
---
name: Feature Request
about: Suggest a feature for this project
labels: enhancement
assignees:
---
<!--- Provide a general summary of your feature request in the title above. -->
<!-- Give your feature a short title here. -->
## My feature title
<!-- Provide a short and clear description of the feature. -->
## Background/problem
<!--
Provide background details to show why this feature is necessary. Is your
feature request related to a problem? If so, please describe the problem.
Provide as much detail as possible.
-->
## Proposal/solution
<!--
Provide a short and clear description of the solution you'd like. Include code
examples, if possible. Feel free to use pseudo-code to show how you think the
feature should work.
-->
## Alternatives
<!-- Describe any alternative solutions or features you've considered. -->
## Additional context
<!-- Please provide any other context or code examples that may help. -->
================================================
FILE: .github/ISSUE_TEMPLATE/Question.md
================================================
---
name: Question
about: Ask a question about how to use this library
labels: question
assignees:
---
<!--- Provide a general summary of your question in the title above. -->
<!-- Write your question here. -->
## How do I... ?
<!-- Provide any additional context that may help us answer your question. -->
## Example code
<!--
If your question is about code that you've written, provide a short and clear
example of what you're trying to accomplish. Try to keep this as short as
possible. If able, please provide an example outside of any framework you are
using. This will help us to quickly respond to your question.
-->
================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
blank_issues_enabled: false
================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
- package-ecosystem: "composer"
allow:
- dependency-type: all
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 1
versioning-strategy: "increase-if-necessary"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 1
================================================
FILE: .github/pull_request_template.md
================================================
<!--- Provide a general summary of your changes in the title above. -->
## Description
<!--- Describe your changes in detail. -->
## Motivation and context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->
## How has this been tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->
## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
## PR checklist
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have read the **CONTRIBUTING.md** document.
- [ ] I have added tests to cover my changes.
================================================
FILE: .github/workflows/continuous-integration.yml
================================================
# GitHub Actions Documentation: https://docs.github.com/en/actions
name: "Continuous Integration"
on:
push:
branches:
- "*.x"
tags:
- "*"
pull_request:
branches:
- "*.x"
# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
# The concurrency group contains the workflow name and the branch name.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
COMPOSER_ROOT_VERSION: "1.99.99"
jobs:
coding-standards:
name: "Coding standards"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout repository"
uses: "actions/checkout@v6"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "latest"
coverage: "none"
- name: "Install dependencies (Composer)"
uses: "ramsey/composer-install@v4"
with:
dependency-versions: "highest"
- name: "Check syntax (php-parallel-lint)"
run: "composer dev:lint:syntax"
- name: "Check coding standards (PHP_CodeSniffer)"
run: "composer dev:lint:style"
static-analysis:
name: "Static analysis"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout repository"
uses: "actions/checkout@v6"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "latest"
coverage: "none"
- name: "Install dependencies (Composer)"
uses: "ramsey/composer-install@v4"
with:
dependency-versions: "highest"
- name: "Statically analyze code (PHPStan)"
run: "composer dev:analyze:phpstan"
benchmark:
name: "Benchmark"
needs: ["coding-standards", "static-analysis"]
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
matrix:
php-version:
- "8.0"
- "8.1"
- "8.2"
- "8.3"
- "8.4"
- "8.5"
steps:
- name: "Checkout repository"
uses: "actions/checkout@v6"
- name: "Install dependencies (apt)"
run: |
sudo apt-get update
sudo apt-get -y install libsodium-dev uuid-dev
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: bcmath, gmp, sodium, uuid
coverage: "none"
ini-values: "memory_limit=-1"
- name: "Install dependencies (Composer)"
uses: "ramsey/composer-install@v4"
with:
dependency-versions: "highest"
- name: "Run benchmarks (PHPBench)"
run: "composer dev:bench"
code-coverage:
name: "Code coverage"
needs: ["coding-standards", "static-analysis"]
runs-on: "ubuntu-latest"
steps:
- name: "Checkout repository"
uses: "actions/checkout@v6"
- name: "Install dependencies (apt)"
run: |
sudo apt-get update
sudo apt-get -y install libsodium-dev uuid-dev
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "latest"
extensions: bcmath, gmp, sodium, uuid
coverage: "xdebug"
ini-values: "memory_limit=-1"
- name: "Install dependencies (Composer)"
uses: "ramsey/composer-install@v4"
with:
dependency-versions: "highest"
- name: "Run unit tests (PHPUnit)"
run: "composer dev:test:coverage:ci"
- name: "Publish coverage report to Codecov"
uses: "codecov/codecov-action@v5"
- name: "Upload test results to Codecov"
if: ${{ !cancelled() }}
uses: "codecov/test-results-action@v1"
with:
disable_search: true
file: "./build/junit.xml"
unit-tests:
name: "Unit Tests"
needs: ["code-coverage"]
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
php-version:
- "8.0"
- "8.1"
- "8.2"
- "8.3"
- "8.4"
- "8.5"
operating-system:
- "ubuntu-latest"
- "windows-latest"
dependency-versions:
- "locked"
- "highest"
steps:
- name: "Configure Git (for Windows)"
if: ${{ matrix.operating-system == 'windows-latest' }}
run: |
git config --system core.autocrlf false
git config --system core.eol lf
- name: "Checkout repository"
uses: "actions/checkout@v6"
- name: "Install dependencies (apt)"
if: ${{ matrix.operating-system == 'ubuntu-latest' }}
run: |
sudo apt-get update
sudo apt-get -y install libsodium-dev uuid-dev
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: bcmath, gmp, sodium, uuid
coverage: "none"
ini-values: "memory_limit=-1"
- name: "Downgrade brick/math in lock file for PHP 8.0"
run: |
composer update brick/math:"0.8.16"
- name: "Install dependencies (Composer)"
uses: "ramsey/composer-install@v4"
with:
dependency-versions: "${{ matrix.dependency-versions }}"
- name: "Run unit tests (PHPUnit)"
run: "composer dev:test:unit"
================================================
FILE: .github/workflows/merge-me.yml
================================================
# Merge Me! Documentation: https://github.com/ridedott/merge-me-action/
name: "Merge Dependabot PRs"
on:
workflow_run:
types:
- "completed"
workflows:
- "Continuous Integration"
jobs:
merge-me:
name: "Merge me!"
runs-on: "ubuntu-latest"
steps:
- name: "Auto-merge"
if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: "ridedott/merge-me-action@v2"
with:
# This must be used as the GitHub Actions token does not support pushing
# to protected branches.
#
# Create a token with repository permissions:
# https://github.com/settings/tokens/new?scopes=repo&description=Merge+Me!+GitHub+Actions+Workflow
#
# Set MERGE_TOKEN as an environment variable on your repository:
# https://github.com/yourname/repo-name/settings/secrets/actions/new
GITHUB_TOKEN: ${{ secrets.MERGE_TOKEN }}
================================================
FILE: .gitignore
================================================
/captainhook.config.json
/phpcs.xml
/phpunit.xml
/vendor/
================================================
FILE: .readthedocs.yml
================================================
version: 2
build:
os: ubuntu-22.04
tools:
python: "3.12"
sphinx:
configuration: docs/conf.py
formats: all
python:
install:
- requirements: docs/requirements.txt
================================================
FILE: CHANGELOG.md
================================================
# ramsey/uuid Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## 4.9.2 - 2025-12-14
### Fixed
* Remove explicit `(int)` cast to avoid float-string cast warnings in PHP 8.5.
* Bump the lowest supported version of brick/math to `^0.8.16` from `^0.8.8`. ramsey/uuid had been using `BigInteger::toBytes()` in `UnixTimeGenerator` (for version 7 UUIDs) since v4.6.0, but it wasn't added to brick/math until v0.8.16.
## 4.9.1 - 2025-09-04
### Fixed
* Allow brick/math version `^0.14`; fixed in [#617](https://github.com/ramsey/uuid/pull/617).
* Default to `microtime()` instead of `DateTimeImmutable` in `Ramsey\Uuid\Generator\UnixTimeGenerator`.
## 4.9.0 - 2025-06-25
### Added
* Add new `@pure` annotations to the following ([#605](https://github.com/ramsey/uuid/pull/605)):
* `Ramsey\Uuid\Codec\CodecInterface::encode()`
* `Ramsey\Uuid\Codec\CodecInterface::encodeBinary()`
* `Ramsey\Uuid\Codec\CodecInterface::decode()`
* `Ramsey\Uuid\Codec\CodecInterface::decodeBytes()`
* `Ramsey\Uuid\Fields\FieldsInterface::getBytes()`
* `Ramsey\Uuid\Math\CalculatorInterface::add()`
* `Ramsey\Uuid\Math\CalculatorInterface::subtract()`
* `Ramsey\Uuid\Math\CalculatorInterface::multiply()`
* `Ramsey\Uuid\Math\CalculatorInterface::divide()`
* `Ramsey\Uuid\Math\CalculatorInterface::fromBase()`
* `Ramsey\Uuid\Math\CalculatorInterface::toBase()`
* `Ramsey\Uuid\Math\CalculatorInterface::toHexadecimal()`
* `Ramsey\Uuid\Math\CalculatorInterface::toInteger()`
* `Ramsey\Uuid\Nonstandard\Uuid`
* `Ramsey\Uuid\Rfc4122\Fields::isMax()`
* `Ramsey\Uuid\Rfc4122\FieldsInterface::getVersion()`
* `Ramsey\Uuid\Rfc4122\FieldsInterface::isNil()`
* `Ramsey\Uuid\Type\Time::getSeconds()`
* `Ramsey\Uuid\Type\Time::getMicroseconds()`
* `Ramsey\Uuid\Type\TypeInterface::toString()`
* `Ramsey\Uuid\UuidInterface::getBytes()`
* `Ramsey\Uuid\UuidInterface::toString()`
* `Ramsey\Uuid\Validator\ValidatorInterface::validate()`
### Fixed
* Restore the `@pure` annotations that were removed in 4.8.0 ([#603](https://github.com/ramsey/uuid/pull/603)).
## 4.8.1 - 2025-06-01
### Fixed
* This tagged release ensures the stable documentation build matches the current stable release.
## 4.8.0 - 2025-06-01
### Deprecated
The following will be removed in ramsey/uuid 5.0.0:
* `Ramsey\Uuid\Codec\OrderedTimeCodec` is deprecated; please migrate to [version 6 UUIDs](https://uuid.ramsey.dev/en/stable/rfc4122/version6.html).
* `Ramsey\Uuid\Codec\TimestampFirstCombCodec` is deprecated; please migrate to [version 7 UUIDs](https://uuid.ramsey.dev/en/stable/rfc4122/version7.html).
* `Ramsey\Uuid\Codec\TimestampLastCombCodec` is deprecated; please use `Ramsey\Uuid\Codec\StringCodec` instead.
* `Ramsey\Uuid\Generator\CombGenerator` is deprecated; please migrate to [version 7 UUIDs](https://uuid.ramsey.dev/en/stable/rfc4122/version7.html).
### Fixed
* Allow brick/math version `^0.13`; fixed in [#589](https://github.com/ramsey/uuid/pull/589).
* Update call to `str_getcsv()` to avoid deprecation notice in PHP 8.4; fixed in [#590](https://github.com/ramsey/uuid/pull/590).
* Hexadecimal is never an empty string; fixed in [#593](https://github.com/ramsey/uuid/pull/593).
* Update docblocks for `Uuid::fromBytes()`, `Uuid::fromString()`, `Uuid::fromDateTime()`, `Uuid::fromHexadecimal()`, and `Uuid::fromInteger()` to note that each can throw `InvalidArgumentException`, addressing PHPStan errors occurring at call sites; fixed in [#552](https://github.com/ramsey/uuid/pull/552).
* `getVariant()` for `MaxUuid` now correctly returns `Uuid::RESERVED_FUTURE`, as specified in [RFC 9562, section 5.10](https://www.rfc-editor.org/rfc/rfc9562#section-5.10).
* `getVariant()` for `NilUuid` now correctly returns `Uuid::RESERVED_NCS`, as specified in [RFC 9562, section 5.9](https://www.rfc-editor.org/rfc/rfc9562#section-5.9).
## 4.7.6 - 2024-04-27
### Fixed
* Allow brick/math version `^0.12`.
## 4.7.5 - 2023-11-08
### Fixed
* Protect against UUIDv7 collisions within the same millisecond, as reported
in [#518](https://github.com/ramsey/uuid/issues/518) and fixed in
[#522](https://github.com/ramsey/uuid/pull/522).
* Improve the return type hint for `UuidInterface::compareTo()`.
## 4.7.4 - 2023-04-15
### Fixed
* Allow brick/math version `^0.11`.
* Add explicit `Stringable` interface to `UuidInterface`.
* Fix namespace conflict reported in [#490](https://github.com/ramsey/uuid/issues/490).
* Fix unserialize error with `OrderedTimeCodec` reported in
[#494](https://github.com/ramsey/uuid/issues/494).
## 4.7.3 - 2023-01-12
### Fixed
* The original 4.7.2 tag accidentally pointed to a commit in the 5.x branch. I
have replaced the 4.7.2 tag with a new tag that points to the correct commit,
but I am creating this tag to help notify users and automated processes who
might have already updated to the bad 4.7.2 tag.
## 4.7.2 - 2023-01-12
### Fixed
* Amend Psalm assertion syntax on `Uuid::isValid()` to prevent incorrect type
inference ([#486](https://github.com/ramsey/uuid/pull/486)).
* Re-tagged with the correct commit hash, since the first tag was pointing to
a commit in the 5.x branch.
## 4.7.1 - 2022-12-31
### Fixed
* Allow the use of ramsey/collection ^2.0 with ramsey/uuid.
## 4.7.0 - 2022-12-19
### Added
* Add `Uuid::fromHexadecimal()` and `UuidFactory::fromHexadecimal()`. These
methods are not required by the interfaces.
### Fixed
* Ignore MAC addresses consisting of all zeroes (i.e., `00:00:00:00:00:00`).
## 4.6.0 - 2022-11-05
### Added
* Add support for version 8, Unix Epoch time UUIDs, as defined in
[draft-ietf-uuidrev-rfc4122bis-00, section 5.8][version8]. While still an
Internet-Draft, version 8 is stable and unlikely to change in any way that
breaks compatibility.
* Use `Ramsey\Uuid\Uuid::uuid8()` to generate version 8 UUIDs.
* Version 8 UUIDs are of type `Ramsey\Uuid\Rfc4122\UuidV8`.
* The constant `Ramsey\Uuid\Uuid::UUID_TYPE_CUSTOM` exists for version 8 UUIDs.
### Fixed
* Ensure monotonicity of version 7 UUIDs.
## 4.5.1 - 2022-09-16
### Fixed
* Update RFC 4122 validator to recognize version 6 and 7 UUIDs.
## 4.5.0 - 2022-09-15
### Added
* Promote version 6, reordered time UUIDs from the `Nonstandard` namespace to
the `Rfc4122` namespace. Version 6 UUIDs are defined in
[draft-ietf-uuidrev-rfc4122bis-00, section 5.6][version6]. While still an
Internet-Draft version 6 is stable and unlikely to change in any way that
breaks compatibility.
* Add support for version 7, Unix Epoch time UUIDs, as defined in
[draft-ietf-uuidrev-rfc4122bis-00, section 5.7][version7]. While still an
Internet-Draft, version 7 is stable and unlikely to change in any way that
breaks compatibility.
* Use `Ramsey\Uuid\Uuid::uuid7()` to generate version 7 UUIDs.
* Version 7 UUIDs are of type `Ramsey\Uuid\Rfc4122\UuidV7`.
* The constant `Ramsey\Uuid\Uuid::UUID_TYPE_UNIX_TIME` exists for version
7 UUIDs.
* Add `Ramsey\Uuid\Converter\Time\UnixTimeConverter` and
`Ramsey\Uuid\Generator\UnixTimeGenerator` to support version 7 UUID generation.
* Add support for [max UUIDs][] through `Ramsey\Uuid\Uuid::MAX` and
`Ramsey\Uuid\Rfc4122\MaxUuid`.
### Changed
* The lowest version of brick/math allowed is now `^0.8.8`.
### Deprecated
The following will be removed in ramsey/uuid 5.0.0:
* `Ramsey\Uuid\Nonstandard\UuidV6` is deprecated in favor of
`Ramsey\Uuid\Rfc4122\UuidV6`.
* `Ramsey\Uuid\Uuid::UUID_TYPE_PEABODY`; use
`Ramsey\Uuid\Uuid::UUID_TYPE_REORDERED_TIME` instead.
### Fixed
* For `Ramsey\Uuid\Uuid::isValid()`, Psalm now asserts the UUID is a
non-empty-string when it is valid.
* Nil UUIDs are properly treated as RFC 4122 variants, and `getVariant()` now
returns a `2` when called on a nil UUID.
## 4.4.0 - 2022-08-05
### Changed
* Allow brick/math 0.10.
* Remove dev dependency to moontoast/math.
* Un-deprecate `UuidInterface::getUrn()`.
## 4.3.1 - 2022-03-27
### Deprecated
The following will be removed in ramsey/uuid 5.0.0:
* `Ramsey\Uuid\Generator\RandomLibAdapter`
## 4.3.0 - 2022-03-26
### Changed
* Remove support for PHP 7.2, 7.3, and 7.4. This is not a BC break, since
Composer will do the right thing for your environment and select a compatible
version of this library.
* Require `ext-ctype` extension. For applications that run in environments where
the `ext-ctype` is not present, please require a polyfill, such as
[symfony/polyfill-ctype](https://packagist.org/packages/symfony/polyfill-ctype).
* Use `iterable<UuidBuilderInterface>` instead of `BuilderCollection` types.
* Use `iterable<NodeProviderInterface>` instead of `NodeProviderCollection` types.
### Deprecated
The following will be removed in ramsey/uuid 5.0.0:
* `Ramsey\Uuid\Builder\BuilderCollection`
* `Ramsey\Uuid\Provider\Node\NodeProviderCollection`
* Dependency on ramsey/collection
### Fixed
* Support valid UUIDs in uppercase in `LazyUuidFromString`.
## 4.2.3 - 2021-09-25
### Fixed
* Switch back to `^8.0` in the PHP version requirement.
## 4.2.2 - 2021-09-24
### Fixed
* Indicate support for PHP 8.1, using `~8.1.0` to prevent installations on 8.2
until the library is ready.
## 4.2.1 - 2021-08-10
### Fixed
* Fix *soft* BC break with `Uuid::fromString()` signature. The change from
`string` to `non-empty-string` on the parameter annotation introduced a
BC break for those using static analysis tools. This release reverts this
change and provides an assertion to guard against empty strings.
See [ramsey/uuid#383](https://github.com/ramsey/uuid/pull/383).
## 4.2.0 - 2021-08-06
### Added
* Add `Ramsey\Uuid\Exception\UuidExceptionInterface` for all ramsey/uuid
exceptions to implement. See [ramsey/uuid#340](https://github.com/ramsey/uuid/pull/340).
### Fixed
* Fix serialization of UUIDs.
See [ramsey/uuid#361](https://github.com/ramsey/uuid/pull/361).
## 4.1.3 - 2021-09-25
### Fixed
* Switch back to `^8.0` in the PHP version requirement.
## 4.1.2 - 2021-09-24
### Fixed
* Lock 4.1.x to `~8.0.0` to indicate it does not support PHP 8.1.
## 4.1.1 - 2020-08-18
### Fixed
* Allow use of brick/math version 0.9
## 4.1.0 - 2020-07-28
### Changed
* Improve performance of `Uuid::fromString()`, `Uuid::fromBytes()`,
`UuidInterface#toString()`, and `UuidInterface#getBytes()`. See PR
[#324](https://github.com/ramsey/uuid/pull/324) for more information.
## 4.0.3 - 2021-09-25
### Fixed
* Switch back to `^8.0` in the PHP version requirement.
## 4.0.2 - 2021-09-24
### Fixed
* Lock 4.0.x to `~8.0.0` to indicate it does not support PHP 8.1.
## 4.0.1 - 2020-03-29
### Fixed
* Fix collection deserialization errors due to upstream `allowed_classes` being
set to `false`. For details, see [ramsey/uuid#303](https://github.com/ramsey/uuid/issues/303)
and [ramsey/collection#47](https://github.com/ramsey/collection/issues/47).
## 4.0.0 - 2020-03-22
### Added
* Add support for version 6 UUIDs, as defined by <http://gh.peabody.io/uuidv6/>,
including the static method `Uuid::uuid6()`, which returns a
`Nonstandard\UuidV6` instance.
* Add ability to generate version 2 (DCE Security) UUIDs, including the static
method `Uuid::uuid2()`, which returns an `Rfc4122\UuidV2` instance.
* Add classes to represent each version of RFC 4122 UUID. When generating new
UUIDs or creating UUIDs from existing strings, bytes, or integers, if the UUID
is an RFC 4122 variant, one of these instances will be returned:
* `Rfc4122\UuidV1`
* `Rfc4122\UuidV2`
* `Rfc4122\UuidV3`
* `Rfc4122\UuidV4`
* `Rfc4122\UuidV5`
* `Rfc4122\NilUuid`
* Add classes to represent version 6 UUIDs, GUIDs, and nonstandard
(non-RFC 4122 variant) UUIDs:
* `Nonstandard\UuidV6`
* `Guid\Guid`
* `Nonstandard\Uuid`
* Add `Uuid::fromDateTime()` to create version 1 UUIDs from instances of
`\DateTimeInterface`.
* The `\DateTimeInterface` instance returned by `UuidInterface::getDateTime()`
(and now `Rfc4122\UuidV1::getDateTime()`) now includes microseconds, as
specified by the version 1 UUID.
* Add `Validator\ValidatorInterface` and `Validator\GenericValidator` to allow
flexibility in validating UUIDs/GUIDs.
* The default validator continues to validate UUID strings using the same
relaxed validation pattern found in the 3.x series of ramsey/uuid.
* Introduce `Rfc4122\Validator` that may be used for strict validation of
RFC 4122 UUID strings.
* Add ability to change the default validator used by `Uuid` through
`FeatureSet::setValidator()`.
* Add `getValidator()` and `setValidator()` to `UuidFactory`.
* Add `Provider\Node\StaticNodeProvider` to assist in setting a custom static
node value with the multicast bit set for version 1 UUIDs.
* Add the following new exceptions:
* `Exception\BuilderNotFoundException` -
Thrown to indicate that no suitable UUID builder could be found.
* `Exception\DateTimeException` -
Thrown to indicate that the PHP DateTime extension encountered an
exception/error.
* `Exception\DceSecurityException` -
Thrown to indicate an exception occurred while dealing with DCE Security
(version 2) UUIDs.
* `Exception\InvalidArgumentException` -
Thrown to indicate that the argument received is not valid. This extends the
built-in PHP `\InvalidArgumentException`, so there should be no BC breaks
with ramsey/uuid throwing this exception, if you are catching the PHP
exception.
* `Exception\InvalidBytesException` -
Thrown to indicate that the bytes being operated on are invalid in some way.
* `Exception\NameException` -
Thrown to indicate that an error occurred while attempting to hash a
namespace and name.
* `Exception\NodeException` -
Throw to indicate that attempting to fetch or create a node ID encountered
an error.
* `Exception\RandomSourceException` -
Thrown to indicate that the source of random data encountered an error.
* `Exception\TimeSourceException` -
Thrown to indicate that the source of time encountered an error.
* `Exception\UnableToBuildUuidException` -
Thrown to indicate a builder is unable to build a UUID.
* Introduce a `Builder\FallbackBuilder`, used by `FeatureSet` to help decide
whether to return a `Uuid` or `Nonstandard\Uuid` when decoding a
UUID string or bytes.
* Add `Rfc4122\UuidInterface` to specifically represent RFC 4122 variant UUIDs.
* Add `Rfc4122\UuidBuilder` to build RFC 4122 variant UUIDs. This replaces the
existing `Builder\DefaultUuidBuilder`, which is now deprecated.
* Introduce `Math\CalculatorInterface` for representing calculators to perform
arithmetic operations on integers.
* Depend on [brick/math](https://github.com/brick/math) for the
`Math\BrickMathCalculator`, which is the default calculator used by this
library when math cannot be performed in native PHP due to integer size
limitations. The calculator is configurable and may be changed, if desired.
* Add `Converter\Number\GenericNumberConverter` and
`Converter\Time\GenericTimeConverter` which will use the calculator provided
to convert numbers and time to values for UUIDs.
* Introduce `Type\Hexadecimal`, `Type\Integer`, `Type\Decimal`, and `Type\Time`
for improved type-safety when dealing with arbitrary string values.
* Add a `Type\TypeInterface` that each of the ramsey/uuid types implements.
* Add `Fields\FieldsInterface` and `Rfc4122\FieldsInterface` to define
field layouts for UUID variants. The implementations `Rfc4122\Fields`,
`Guid\Fields`, and `Nonstandard\Fields` store the 16-byte,
binary string representation of the UUID internally, and these manage
conversion of the binary string into the hexadecimal field values.
* Introduce `Builder\BuilderCollection` and `Provider\Node\NodeProviderCollection`.
These are typed collections for providing builders and node providers to
`Builder\FallbackBuilder` and `Provider\Node\FallbackNodeProvider`, respectively.
* Add `Generator\NameGeneratorInterface` to support alternate methods of
generating bytes for version 3 and version 5 name-based UUID. By default,
ramsey/uuid uses the `Generator\DefaultNameGenerator`, which uses the standard
algorithm this library has used since the beginning. You may choose to use the
new `Generator\PeclUuidNameGenerator` to make use of the new
`uuid_generate_md5()` and `uuid_generate_sha1()` functions in
[ext-uuid version 1.1.0](https://pecl.php.net/package/uuid).
### Changed
* Set minimum required PHP version to 7.2.
* This library now works on 32-bit and 64-bit systems, with no degradation in
functionality.
* By default, the following static methods will now return specific instance
types. This should not cause any BC breaks if typehints target `UuidInterface`:
* `Uuid::uuid1` returns `Rfc4122\UuidV1`
* `Uuid::uuid3` returns `Rfc4122\UuidV3`
* `Uuid::uuid4` returns `Rfc4122\UuidV4`
* `Uuid::uuid5` returns `Rfc4122\UuidV5`
* Accept `Type\Hexadecimal` for the `$node` parameter for
`UuidFactoryInterface::uuid1()`. This is in addition to the `int|string` types
already accepted, so there are no BC breaks. `Type\Hexadecimal` is now the
recommended type to pass for `$node`.
* Out of the box, `Uuid::fromString()`, `Uuid::fromBytes()`, and
`Uuid::fromInteger()` will now return either an `Rfc4122\UuidInterface`
instance or an instance of `Nonstandard\Uuid`, depending on whether the input
contains an RFC 4122 variant UUID with a valid version identifier. Both
implement `UuidInterface`, so BC breaks should not occur if typehints use the
interface.
* Change `Uuid::getFields()` to return an instance of `Fields\FieldsInterface`.
Previously, it returned an array of integer values (on 64-bit systems only).
* `Uuid::getDateTime()` now returns an instance of `\DateTimeImmutable` instead
of `\DateTime`.
* Make the following changes to `UuidInterface`:
* `getHex()` now returns a `Type\Hexadecimal` instance.
* `getInteger()` now returns a `Type\Integer` instance. The `Type\Integer`
instance holds a string representation of a 128-bit integer. You may then
use a math library of your choice (bcmath, gmp, etc.) to operate on the
string integer.
* `getDateTime()` now returns `\DateTimeInterface` instead of `\DateTime`.
* Add `__toString()` method.
* Add `getFields()` method. It returns an instance of `Fields\FieldsInterface`.
* Add the following new methods to `UuidFactoryInterface`:
* `uuid2()`
* `uuid6()`
* `fromDateTime()`
* `fromInteger()`
* `getValidator()`
* This library no longer throws generic exceptions. However, this should not
result in BC breaks, since the new exceptions extend from built-in PHP
exceptions that this library previously threw.
* `Exception\UnsupportedOperationException` is now descended from
`\LogicException`. Previously, it descended from `\RuntimeException`.
* Change required constructor parameters for `Uuid`:
* Change the first required constructor parameter for `Uuid` from
`array $fields` to `Rfc4122\FieldsInterface $fields`.
* Add `Converter\TimeConverterInterface $timeConverter` as the fourth
required constructor parameter for `Uuid`.
* Change the second required parameter of `Builder\UuidBuilderInterface::build()`
from `array $fields` to `string $bytes`. Rather than accepting an array of
hexadecimal strings as UUID fields, the `build()` method now expects a byte
string.
* Add `Converter\TimeConverterInterface $timeConverter` as the second required
constructor parameter for `Rfc4122\UuidBuilder`. This also affects the
now-deprecated `Builder\DefaultUuidBuilder`, since this class now inherits
from `Rfc4122\UuidBuilder`.
* Add `convertTime()` method to `Converter\TimeConverterInterface`.
* Add `getTime()` method to `Provider\TimeProviderInterface`. It replaces the
`currentTime()` method.
* `Provider\Node\FallbackNodeProvider` now accepts only a
`Provider\Node\NodeProviderCollection` as its constructor parameter.
* `Provider\Time\FixedTimeProvider` no longer accepts an array but accepts only
`Type\Time` instances.
* `Provider\NodeProviderInterface::getNode()` now returns `Type\Hexadecimal`
instead of `string|false|null`.
* `Converter/TimeConverterInterface::calculateTime()` now returns
`Type\Hexadecimal` instead of `array`. The value is the full UUID timestamp
value (count of 100-nanosecond intervals since the Gregorian calendar epoch)
in hexadecimal format.
* Change methods in `NumberConverterInterface` to accept and return string values
instead of `mixed`; this simplifies the interface and makes it consistent.
* `Generator\DefaultTimeGenerator` no longer adds the variant and version bits
to the bytes it returns. These must be applied to the bytes afterwards.
* When encoding to bytes or decoding from bytes, `OrderedTimeCodec` now checks
whether the UUID is an RFC 4122 variant, version 1 UUID. If not, it will throw
an exception—`InvalidArgumentException` when using
`OrderedTimeCodec::encodeBinary()` and `UnsupportedOperationException` when
using `OrderedTimeCodec::decodeBytes()`.
### Deprecated
The following functionality is deprecated and will be removed in ramsey/uuid
5.0.0.
* The following methods from `UuidInterface` and `Uuid` are deprecated. Use their
counterparts on the `Rfc4122\FieldsInterface` returned by `Uuid::getFields()`.
* `getClockSeqHiAndReservedHex()`
* `getClockSeqLowHex()`
* `getClockSequenceHex()`
* `getFieldsHex()`
* `getNodeHex()`
* `getTimeHiAndVersionHex()`
* `getTimeLowHex()`
* `getTimeMidHex()`
* `getTimestampHex()`
* `getVariant()`
* `getVersion()`
* The following methods from `Uuid` are deprecated. Use the `Rfc4122\FieldsInterface`
instance returned by `Uuid::getFields()` to get the `Type\Hexadecimal` value
for these fields. You may use the new `Math\CalculatorInterface::toIntegerValue()`
method to convert the `Type\Hexadecimal` instances to instances of
`Type\Integer`. This library provides `Math\BrickMathCalculator`, which may be
used for this purpose, or you may use the arbitrary-precision arithmetic
library of your choice.
* `getClockSeqHiAndReserved()`
* `getClockSeqLow()`
* `getClockSequence()`
* `getNode()`
* `getTimeHiAndVersion()`
* `getTimeLow()`
* `getTimeMid()`
* `getTimestamp()`
* `getDateTime()` on `UuidInterface` and `Uuid` is deprecated. Use this method
only on instances of `Rfc4122\UuidV1` or `Nonstandard\UuidV6`.
* `getUrn()` on `UuidInterface` and `Uuid` is deprecated. It is available on
`Rfc4122\UuidInterface` and classes that implement it.
* The following methods are deprecated and have no direct replacements. However,
you may obtain the same information by calling `UuidInterface::getHex()` and
splitting the return value in half.
* `UuidInterface::getLeastSignificantBitsHex()`
* `UuidInterface::getMostSignificantBitsHex()`
* `Uuid::getLeastSignificantBitsHex()`
* `Uuid::getMostSignificantBitsHex()`
* `Uuid::getLeastSignificantBits()`
* `Uuid::getMostSignificantBits()`
* `UuidInterface::getNumberConverter()` and `Uuid::getNumberConverter()` are
deprecated. There is no alternative recommendation, so plan accordingly.
* `Builder\DefaultUuidBuilder` is deprecated; transition to `Rfc4122\UuidBuilder`.
* `Converter\Number\BigNumberConverter` is deprecated; transition to
`Converter\Number\GenericNumberConverter`.
* `Converter\Time\BigNumberTimeConverter` is deprecated; transition to
`Converter\Time\GenericTimeConverter`.
* The classes for representing and generating *degraded* UUIDs are deprecated.
These are no longer necessary; this library now behaves the same on 32-bit and
64-bit systems.
* `Builder\DegradedUuidBuilder`
* `Converter\Number\DegradedNumberConverter`
* `Converter\Time\DegradedTimeConverter`
* `DegradedUuid`
* The `Uuid::UUID_TYPE_IDENTIFIER` constant is deprecated. Use
`Uuid::UUID_TYPE_DCE_SECURITY` instead.
* The `Uuid::VALID_PATTERN` constant is deprecated. Use
`Validator\GenericValidator::getPattern()` or `Rfc4122\Validator::getPattern()`
instead.
### Removed
* Remove the following bytes generators and recommend
`Generator\RandomBytesGenerator` as a suitable replacement:
* `Generator\MtRandGenerator`
* `Generator\OpenSslGenerator`
* `Generator\SodiumRandomGenerator`
* Remove `Exception\UnsatisfiedDependencyException`. This library no longer
throws this exception.
* Remove the method `Provider\TimeProviderInterface::currentTime()`. Use
`Provider\TimeProviderInterface::getTime()` instead.
## 4.0.0-beta2 - 2020-03-01
## Added
* Add missing convenience methods for `Rfc4122\UuidV2`.
* Add `Provider\Node\StaticNodeProvider` to assist in setting a custom static
node value with the multicast bit set for version 1 UUIDs.
## Changed
* `Provider\NodeProviderInterface::getNode()` now returns `Type\Hexadecimal`
instead of `string|false|null`.
## 4.0.0-beta1 - 2020-02-27
### Added
* Add `ValidatorInterface::getPattern()` to return the regular expression
pattern used by the validator.
* Add `v6()` helper function for version 6 UUIDs.
### Changed
* Set the pattern constants on validators as `private`. Use the `getPattern()`
method instead.
* Change the `$node` parameter for `UuidFactoryInterface::uuid6()` to accept
`null` or `Type\Hexadecimal`.
* Accept `Type\Hexadecimal` for the `$node` parameter for
`UuidFactoryInterface::uuid1()`. This is in addition to the `int|string` types
already accepted, so there are no BC breaks. `Type\Hexadecimal` is now the
recommended type to pass for `$node`.
### Removed
* Remove `currentTime()` method from `Provider\Time\FixedTimeProvider` and
`Provider\Time\SystemTimeProvider`; it had previously been removed from
`Provider\TimeProviderInterface`.
## 4.0.0-alpha5 - 2020-02-23
### Added
* Introduce `Builder\BuilderCollection` and `Provider\Node\NodeProviderCollection`.
### Changed
* `Builder\FallbackBuilder` now accepts only a `Builder\BuilderCollection` as
its constructor parameter.
* `Provider\Node\FallbackNodeProvider` now accepts only a `Provider\Node\NodeProviderCollection`
as its constructor parameter.
* `Provider\Time\FixedTimeProvider` no longer accepts an array but accepts only
`Type\Time` instances.
## 4.0.0-alpha4 - 2020-02-23
### Added
* Add a `Type\TypeInterface` that each of the ramsey/uuid types implements.
* Support version 6 UUIDs; see <http://gh.peabody.io/uuidv6/>.
### Changed
* Rename `Type\IntegerValue` to `Type\Integer`. It was originally named
`IntegerValue` because static analysis sees `Integer` in docblock annotations
and treats it as the native `int` type. `Integer` is not a reserved word in
PHP, so it should be named `Integer` for consistency with other types in this
library. When using it, a class alias prevents static analysis from
complaining.
* Mark `Guid\Guid` and `Nonstandard\Uuid` classes as `final`.
* Add `uuid6()` method to `UuidFactoryInterface`.
### Deprecated
* `Uuid::UUID_TYPE_IDENTIFIER` is deprecated. Use `Uuid::UUID_TYPE_DCE_SECURITY`
instead.
* `Uuid::VALID_PATTERN` is deprecated. Use `Validator\GenericValidator::VALID_PATTERN`
instead.
## 4.0.0-alpha3 - 2020-02-21
### Fixed
* Fix microsecond rounding error on 32-bit systems.
## 4.0.0-alpha2 - 2020-02-21
### Added
* Add `Uuid::fromDateTime()` to create version 1 UUIDs from instances of
`\DateTimeInterface`.
* Add `Generator\NameGeneratorInterface` to support alternate methods of
generating bytes for version 3 and version 5 name-based UUID. By default,
ramsey/uuid uses the `Generator\DefaultNameGenerator`, which uses the standard
algorithm this library has used since the beginning. You may choose to use the
new `Generator\PeclUuidNameGenerator` to make use of the new
`uuid_generate_md5()` and `uuid_generate_sha1()` functions in ext-uuid version
1.1.0.
### Changed
* Add `fromDateTime()` method to `UuidFactoryInterface`.
* Change `UuidInterface::getHex()` to return a `Ramsey\Uuid\Type\Hexadecimal` instance.
* Change `UuidInterface::getInteger()` to return a `Ramsey\Uuid\Type\IntegerValue` instance.
### Fixed
* Round microseconds to six digits when getting DateTime from v1 UUIDs. This
circumvents a needless exception for an otherwise valid time-based UUID.
## 4.0.0-alpha1 - 2020-01-22
### Added
* Add `Validator\ValidatorInterface` and `Validator\GenericValidator` to allow
flexibility in validating UUIDs/GUIDs.
* Add ability to change the default validator used by `Uuid` through
`FeatureSet::setValidator()`.
* Add `getValidator()` and `setValidator()` to `UuidFactory`.
* Add an internal `InvalidArgumentException` that descends from the built-in
PHP `\InvalidArgumentException`. All places that used to throw
`\InvalidArgumentException` now throw `Ramsey\Uuid\Exception\InvalidArgumentException`.
This should not cause any BC breaks, however.
* Add an internal `DateTimeException` that descends from the built-in PHP
`\RuntimeException`. `Uuid::getDateTime()` may throw this exception if
`\DateTimeImmutable` throws an error or exception.
* Add `RandomSourceException` that descends from the built-in PHP
`\RuntimeException`. `DefaultTimeGenerator`, `RandomBytesGenerator`, and
`RandomNodeProvider` may throw this exception if `random_bytes()` or
`random_int()` throw an error or exception.
* Add `Fields\FieldsInterface` and `Rfc4122\FieldsInterface` to define
field layouts for UUID variants. The implementations `Rfc4122\Fields`,
`Guid\Fields`, and `Nonstandard\Fields` store the 16-byte,
binary string representation of the UUID internally, and these manage
conversion of the binary string into the hexadecimal field values.
* Add `Rfc4122\UuidInterface` to specifically represent RFC 4122 variant UUIDs.
* Add classes to represent each version of RFC 4122 UUID. When generating new
UUIDs or creating UUIDs from existing strings, bytes, or integers, if the UUID
is an RFC 4122 variant, one of these instances will be returned:
* `Rfc4122\UuidV1`
* `Rfc4122\UuidV2`
* `Rfc4122\UuidV3`
* `Rfc4122\UuidV4`
* `Rfc4122\UuidV5`
* `Rfc4122\NilUuid`
* Add `Rfc4122\UuidBuilder` to build RFC 4122 variant UUIDs. This replaces the
existing `Builder\DefaultUuidBuilder`, which is now deprecated.
* Add ability to generate version 2 (DCE Security) UUIDs, including the static
method `Uuid::uuid2()`, which returns an `Rfc4122\UuidV2` instance.
* Add classes to represent GUIDs and nonstandard (non-RFC 4122 variant) UUIDs:
* `Guid\Guid`
* `Nonstandard\Uuid`.
* Introduce a `Builder\FallbackBuilder`, used by `FeatureSet` to help decide
whether to return a `Uuid` or `Nonstandard\Uuid` when decoding a
UUID string or bytes.
* Introduce `Type\Hexadecimal`, `Type\IntegerValue`, and `Type\Time` for
improved type-safety when dealing with arbitrary string values.
* Introduce `Math\CalculatorInterface` for representing calculators to perform
arithmetic operations on integers.
* Depend on [brick/math](https://github.com/brick/math) for the
`Math\BrickMathCalculator`, which is the default calculator used by this
library when math cannot be performed in native PHP due to integer size
limitations. The calculator is configurable and may be changed, if desired.
* Add `Converter\Number\GenericNumberConverter` and
`Converter\Time\GenericTimeConverter` which will use the calculator provided
to convert numbers and time to values for UUIDs.
* The `\DateTimeInterface` instance returned by `UuidInterface::getDateTime()`
(and now `Rfc4122\UuidV1::getDateTime()`) now includes microseconds, as
specified by the version 1 UUID.
### Changed
* Set minimum required PHP version to 7.2.
* Add `__toString()` method to `UuidInterface`.
* The `UuidInterface::getDateTime()` method now specifies `\DateTimeInterface`
as the return value, rather than `\DateTime`; `Uuid::getDateTime()` now
returns an instance of `\DateTimeImmutable` instead of `\DateTime`.
* Add `getFields()` method to `UuidInterface`.
* Add `getValidator()` method to `UuidFactoryInterface`.
* Add `uuid2()` method to `UuidFactoryInterface`.
* Add `convertTime()` method to `Converter\TimeConverterInterface`.
* Add `getTime()` method to `Provider\TimeProviderInterface`.
* Change `Uuid::getFields()` to return an instance of `Fields\FieldsInterface`.
Previously, it returned an array of integer values (on 64-bit systems only).
* Change the first required constructor parameter for `Uuid` from
`array $fields` to `Rfc4122\FieldsInterface $fields`.
* Introduce `Converter\TimeConverterInterface $timeConverter` as fourth required
constructor parameter for `Uuid` and second required constructor parameter for
`Builder\DefaultUuidBuilder`.
* Change `UuidInterface::getInteger()` to always return a `string` value instead
of `mixed`. This is a string representation of a 128-bit integer. You may then
use a math library of your choice (bcmath, gmp, etc.) to operate on the
string integer.
* Change the second required parameter of `Builder\UuidBuilderInterface::build()`
from `array $fields` to `string $bytes`. Rather than accepting an array of
hexadecimal strings as UUID fields, the `build()` method now expects a byte
string.
* `Generator\DefaultTimeGenerator` no longer adds the variant and version bits
to the bytes it returns. These must be applied to the bytes afterwards.
* `Converter/TimeConverterInterface::calculateTime()` now returns
`Type\Hexadecimal` instead of `array`. The value is the full UUID timestamp
value (count of 100-nanosecond intervals since the Gregorian calendar epoch)
in hexadecimal format.
* Change methods in converter interfaces to accept and return string values
instead of `mixed`; this simplifies the interface and makes it consistent:
* `NumberConverterInterface::fromHex(string $hex): string`
* `NumberConverterInterface::toHex(string $number): string`
* `TimeConverterInterface::calculateTime(string $seconds, string $microseconds): array`
* `UnsupportedOperationException` is now descended from `\LogicException`.
Previously, it descended from `\RuntimeException`.
* When encoding to bytes or decoding from bytes, `OrderedTimeCodec` now checks
whether the UUID is an RFC 4122 variant, version 1 UUID. If not, it will throw
an exception—`InvalidArgumentException` when using
`OrderedTimeCodec::encodeBinary()` and `UnsupportedOperationException` when
using `OrderedTimeCodec::decodeBytes()`.
* Out of the box, `Uuid::fromString()`, `Uuid::fromBytes()`, and
`Uuid::fromInteger()` will now return either an `Rfc4122\UuidInterface`
instance or an instance of `Nonstandard\Uuid`, depending on whether the input
contains an RFC 4122 variant UUID with a valid version identifier. Both
implement `UuidInterface`, so BC breaks should not occur if typehints use the
interface.
* By default, the following static methods will now return the specific instance
types. This should not cause any BC breaks if typehints target `UuidInterface`:
* `Uuid::uuid1` returns `Rfc4122\UuidV1`
* `Uuid::uuid3` returns `Rfc4122\UuidV3`
* `Uuid::uuid4` returns `Rfc4122\UuidV4`
* `Uuid::uuid5` returns `Rfc4122\UuidV5`
### Deprecated
The following functionality is deprecated and will be removed in ramsey/uuid
5.0.0.
* The following methods from `UuidInterface` and `Uuid` are deprecated. Use their
counterparts on the `Rfc4122\FieldsInterface` returned by `Uuid::getFields()`.
* `getClockSeqHiAndReservedHex()`
* `getClockSeqLowHex()`
* `getClockSequenceHex()`
* `getFieldsHex()`
* `getNodeHex()`
* `getTimeHiAndVersionHex()`
* `getTimeLowHex()`
* `getTimeMidHex()`
* `getTimestampHex()`
* `getVariant()`
* `getVersion()`
* The following methods from `Uuid` are deprecated. Use the `Rfc4122\FieldsInterface`
instance returned by `Uuid::getFields()` to get the `Type\Hexadecimal` value
for these fields, and then use the arbitrary-precision arithmetic library of
your choice to convert them to string integers.
* `getClockSeqHiAndReserved()`
* `getClockSeqLow()`
* `getClockSequence()`
* `getNode()`
* `getTimeHiAndVersion()`
* `getTimeLow()`
* `getTimeMid()`
* `getTimestamp()`
* `getDateTime()` on `UuidInterface` and `Uuid` is deprecated. Use this method
only on instances of `Rfc4122\UuidV1`.
* `getUrn()` on `UuidInterface` and `Uuid` is deprecated. It is available on
`Rfc4122\UuidInterface` and classes that implement it.
* The following methods are deprecated and have no direct replacements. However,
you may obtain the same information by calling `UuidInterface::getHex()` and
splitting the return value in half.
* `UuidInterface::getLeastSignificantBitsHex()`
* `UuidInterface::getMostSignificantBitsHex()`
* `Uuid::getLeastSignificantBitsHex()`
* `Uuid::getMostSignificantBitsHex()`
* `Uuid::getLeastSignificantBits()`
* `Uuid::getMostSignificantBits()`
* `UuidInterface::getNumberConverter()` and `Uuid::getNumberConverter()` are
deprecated. There is no alternative recommendation, so plan accordingly.
* `Builder\DefaultUuidBuilder` is deprecated; transition to
`Rfc4122\UuidBuilder`.
* `Converter\Number\BigNumberConverter` is deprecated; transition to
`Converter\Number\GenericNumberConverter`.
* `Converter\Time\BigNumberTimeConverter` is deprecated; transition to
`Converter\Time\GenericTimeConverter`.
* `Provider\TimeProviderInterface::currentTime()` is deprecated; transition to
the `getTimestamp()` method on the same interface.
* The classes for representing and generating *degraded* UUIDs are deprecated.
These are no longer necessary; this library now behaves the same on 32-bit and
64-bit PHP.
* `Builder\DegradedUuidBuilder`
* `Converter\Number\DegradedNumberConverter`
* `Converter\Time\DegradedTimeConverter`
* `DegradedUuid`
### Removed
* Remove the following bytes generators and recommend
`Generator\RandomBytesGenerator` as a suitable replacement:
* `Generator\MtRandGenerator`
* `Generator\OpenSslGenerator`
* `Generator\SodiumRandomGenerator`
* Remove `Exception\UnsatisfiedDependencyException`. This library no longer
throws this exception.
## 3.9.7 - 2022-12-19
### Fixed
* Add `#[ReturnTypeWillChange]` to `Uuid::jsonSerialize()` method.
## 3.9.6 - 2021-09-25
### Fixed
* Switch back to `^8.0` in the PHP version requirement.
## 3.9.5 - 2021-09-24
### Fixed
* Indicate support for PHP 8.1, using `~8.1.0` to prevent installations on 8.2
until the library is ready.
## 3.9.4 - 2021-08-06
### Fixed
* Allow installation of paragonie/random_compat v9.99.100 (for PHP 8 compatibility).
## 3.9.3 - 2020-02-20
### Fixed
* For v1 UUIDs, round down for timestamps so that microseconds do not bump the
timestamp to the next second.
As an example, consider the case of timestamp `1` with `600000` microseconds
(`1.600000`). This is the first second after midnight on January 1, 1970, UTC.
Previous versions of this library had a bug that would round this to `2`, so
the rendered time was `1970-01-01 00:00:02`. This was incorrect. Despite
having `600000` microseconds, the time should not round up to the next second.
Rather, the time should be `1970-01-01 00:00:01.600000`. Since this version of
ramsey/uuid does not support microseconds, the microseconds are dropped, and
the time is `1970-01-01 00:00:01`. No rounding should occur.
## 3.9.2 - 2019-12-17
### Fixed
* Check whether files returned by `/sys/class/net/*/address` are readable
before attempting to read them. This avoids a PHP warning that was being
emitted on hosts that do not grant permission to read these files.
## 3.9.1 - 2019-12-01
### Fixed
* Fix `RandomNodeProvider` behavior on 32-bit systems. The `RandomNodeProvider`
was converting a 6-byte string to a decimal number, which is a 48-bit,
unsigned integer. This caused problems on 32-bit systems and has now been
resolved.
## 3.9.0 - 2019-11-30
### Added
* Add function API as convenience. The functions are available in the
`Ramsey\Uuid` namespace.
* `v1(int|string|null $node = null, int|null $clockSeq = null): string`
* `v3(string|UuidInterface $ns, string $name): string`
* `v4(): string`
* `v5(string|UuidInterface $ns, string $name): string`
### Changed
* Use paragonie/random-lib instead of ircmaxell/random-lib. This is a
non-breaking change.
* Use a high-strength generator by default, when using `RandomLibAdapter`. This
is a non-breaking change.
### Deprecated
These will be removed in ramsey/uuid version 4.0.0:
* `MtRandGenerator`, `OpenSslGenerator`, and `SodiumRandomGenerator` are
deprecated in favor of using the default `RandomBytesGenerator`.
### Fixed
* Set `ext-json` as a required dependency in `composer.json`.
* Use `PHP_OS` instead of `php_uname()` when determining the system OS, for
cases when `php_uname()` is disabled for security reasons.
## 3.8.0 - 2018-07-19
### Added
* Support discovery of MAC addresses on FreeBSD systems
* Use a polyfill to provide PHP ctype functions when running on systems where the
ctype functions are not part of the PHP build
* Disallow a trailing newline character when validating UUIDs
* Annotate thrown exceptions for improved IDE hinting
## 3.7.3 - 2018-01-19
### Fixed
* Gracefully handle cases where `glob()` returns false when searching
`/sys/class/net/*/address` files on Linux
* Fix off-by-one error in `DefaultTimeGenerator`
### Security
* Switch to `random_int()` from `mt_rand()` for better random numbers
## 3.7.2 - 2018-01-13
### Fixed
* Check sysfs on Linux to determine the node identifier; this provides a
reliable way to identify the node on Docker images, etc.
## 3.7.1 - 2017-09-22
### Fixed
* Set the multicast bit for random nodes, according to RFC 4122, §4.5
### Security
* Use `random_bytes()` when generating random nodes
## 3.7.0 - 2017-08-04
### Added
* Add the following UUID version constants:
* `Uuid::UUID_TYPE_TIME`
* `Uuid::UUID_TYPE_IDENTIFIER`
* `Uuid::UUID_TYPE_HASH_MD5`
* `Uuid::UUID_TYPE_RANDOM`
* `Uuid::UUID_TYPE_HASH_SHA1`
## 3.6.1 - 2017-03-26
### Fixed
* Optimize UUID string decoding by using `str_pad()` instead of `sprintf()`
## 3.6.0 - 2017-03-18
### Added
* Add `InvalidUuidStringException`, which is thrown when attempting to decode an
invalid string UUID; this does not introduce any BC issues, since the new
exception inherits from the previously used `InvalidArgumentException`
### Fixed
* Improve memory usage when generating large quantities of UUIDs (use `str_pad()`
and `dechex()` instead of `sprintf()`)
## 3.5.2 - 2016-11-22
### Fixed
* Improve test coverage
## 3.5.1 - 2016-10-02
### Fixed
* Fix issue where the same UUIDs were not being treated as equal when using
mixed cases
## 3.5.0 - 2016-08-02
### Added
* Add `OrderedTimeCodec` to store UUID in an optimized way for InnoDB
### Fixed
* Fix invalid node generation in `RandomNodeProvider`
* Avoid multiple unnecessary system calls by caching failed attempt to retrieve
system node
## 3.4.1 - 2016-04-23
### Fixed
* Fix test that violated a PHP CodeSniffer rule, breaking the build
## 3.4.0 - 2016-04-23
### Added
* Add `TimestampFirstCombCodec` and `TimestampLastCombCodec` codecs to provide
the ability to generate [COMB sequential UUIDs] with the timestamp encoded as
either the first 48 bits or the last 48 bits
* Improve logic of `CombGenerator` for COMB sequential UUIDs
## 3.3.0 - 2016-03-22
### Security
* Drop the use of OpenSSL as a fallback and use [paragonie/random_compat] to
support `RandomBytesGenerator` in versions of PHP earlier than 7.0;
this addresses and fixes the [collision issue]
## 3.2.0 - 2016-02-17
### Added
* Add `SodiumRandomGenerator` to allow use of the [PECL libsodium extension] as
a random bytes generator when creating UUIDs
## 3.1.0 - 2015-12-17
### Added
* Implement the PHP `Serializable` interface to provide the ability to
serialize/unserialize UUID objects
## 3.0.1 - 2015-10-21
### Added
* Adopt the [Contributor Code of Conduct] for this project
## 3.0.0 - 2015-09-28
The 3.0.0 release represents a significant step for the ramsey/uuid library.
While the simple and familiar API used in previous versions remains intact, this
release provides greater flexibility to integrators, including the ability to
inject your own number generators, UUID codecs, node and time providers, and
more.
*Please note: The changelog for 3.0.0 includes all notes from the alpha and beta
versions leading up to this release.*
### Added
* Add a number of generators that may be used to override the library defaults
for generating random bytes (version 4) or time-based (version 1) UUIDs
* `CombGenerator` to allow generation of sequential UUIDs
* `OpenSslGenerator` to generate random bytes on systems where
`openssql_random_pseudo_bytes()` is present
* `MtRandGenerator` to provide a fallback in the event other random generators
are not present
* `RandomLibAdapter` to allow use of [ircmaxell/random-lib]
* `RandomBytesGenerator` for use with PHP 7; ramsey/uuid will default to use
this generator when running on PHP 7
* Refactor time-based (version 1) UUIDs into a `TimeGeneratorInterface` to
allow for other sources to generate version 1 UUIDs in this library
* `PeclUuidTimeGenerator` and `PeclUuidRandomGenerator` for creating version
1 or version 4 UUIDs using the pecl-uuid extension
* Add a `setTimeGenerator` method on `UuidFactory` to override the default time
generator
* Add option to enable `PeclUuidTimeGenerator` via `FeatureSet`
* Support GUID generation by configuring a `FeatureSet` to use GUIDs
* Allow UUIDs to be serialized as JSON through `JsonSerializable`
### Changed
* Change root namespace from "Rhumsaa" to "Ramsey;" in most cases, simply
making this change in your applications is the only upgrade path you will
need—everything else should work as expected
* No longer consider `Uuid` class as `final`; everything is now based around
interfaces and factories, allowing you to use this package as a base to
implement other kinds of UUIDs with different dependencies
* Return an object of type `DegradedUuid` on 32-bit systems to indicate that
certain features are not available
* Default `RandomLibAdapter` to a medium-strength generator with
[ircmaxell/random-lib]; this is configurable, so other generator strengths may
be used
### Removed
* Remove `PeclUuidFactory` in favor of using pecl-uuid with generators
* Remove `timeConverter` and `timeProvider` properties, setters, and getters in
both `FeatureSet` and `UuidFactory` as those are now exclusively used by the
default `TimeGenerator`
* Move UUID [Doctrine field type] to [ramsey/uuid-doctrine]
* Move `uuid` console application to [ramsey/uuid-console]
* Remove `Uuid::VERSION` package version constant
### Fixed
* Improve GUID support to ensure that:
* On little endian (LE) architectures, the byte order of the first three
fields is LE
* On big endian (BE) architectures, it is the same as a GUID
* String representation is always the same
* Fix exception message for `DegradedNumberConverter::fromHex()`
## 3.0.0-beta1 - 2015-08-31
### Fixed
* Improve GUID support to ensure that:
* On little endian (LE) architectures, the byte order of the first three
fields is LE
* On big endian (BE) architectures, it is the same as a GUID
* String representation is always the same
* Fix exception message for `DegradedNumberConverter::fromHex()`
## 3.0.0-alpha3 - 2015-07-28
### Added
* Enable use of custom `TimeGenerator` implementations
* Add a `setTimeGenerator` method on `UuidFactory` to override the default time
generator
* Add option to enable `PeclUuidTimeGenerator` via `FeatureSet`
### Removed
* Remove `timeConverter` and `timeProvider` properties, setters, and getters in
both `FeatureSet` and `UuidFactory` as those are now exclusively used by the
default `TimeGenerator`
## 3.0.0-alpha2 - 2015-07-28
### Added
* Refactor time-based (version 1) UUIDs into a `TimeGeneratorInterface` to allow
for other sources to generate version 1 UUIDs in this library
* Add `PeclUuidTimeGenerator` and `PeclUuidRandomGenerator` for creating version
1 or version 4 UUIDs using the pecl-uuid extension
* Add `RandomBytesGenerator` for use with PHP 7. ramsey/uuid will default to use
this generator when running on PHP 7
### Changed
* Default `RandomLibAdapter` to a medium-strength generator with
[ircmaxell/random-lib]; this is configurable, so other generator strengths may
be used
### Removed
* Remove `PeclUuidFactory` in favor of using pecl-uuid with generators
## 3.0.0-alpha1 - 2015-07-16
### Added
* Allow dependency injection through `UuidFactory` and/or extending `FeatureSet`
to override any package defaults
* Add a number of generators that may be used to override the library defaults:
* `CombGenerator` to allow generation of sequential UUIDs
* `OpenSslGenerator` to generate random bytes on systems where
`openssql_random_pseudo_bytes()` is present
* `MtRandGenerator` to provide a fallback in the event other random generators
are not present
* `RandomLibAdapter` to allow use of [ircmaxell/random-lib]
* Support GUID generation by configuring a `FeatureSet` to use GUIDs
* Allow UUIDs to be serialized as JSON through `JsonSerializable`
### Changed
* Change root namespace from "Rhumsaa" to "Ramsey;" in most cases, simply
making this change in your applications is the only upgrade path you will
need—everything else should work as expected
* No longer consider `Uuid` class as `final`; everything is now based around
interfaces and factories, allowing you to use this package as a base to
implement other kinds of UUIDs with different dependencies
* Return an object of type `DegradedUuid` on 32-bit systems to indicate that
certain features are not available
### Removed
* Move UUID [Doctrine field type] to [ramsey/uuid-doctrine]
* Move `uuid` console application to [ramsey/uuid-console]
* Remove `Uuid::VERSION` package version constant
## 2.9.0 - 2016-03-22
### Security
* Drop the use of OpenSSL as a fallback and use [paragonie/random_compat] to
support `RandomBytesGenerator` in versions of PHP earlier than 7.0;
this addresses and fixes the [collision issue]
## 2.8.4 - 2015-12-17
### Added
* Add support for symfony/console v3 in the `uuid` CLI application
## 2.8.3 - 2015-08-31
### Fixed
* Fix exception message in `Uuid::calculateUuidTime()`
## 2.8.2 - 2015-07-23
### Fixed
* Ensure the release tag makes it into the rhumsaa/uuid package
## 2.8.1 - 2015-06-16
### Fixed
* Use `passthru()` and output buffering in `getIfconfig()`
* Cache the system node in a static variable so that we process it only once per
runtime
## 2.8.0 - 2014-11-09
### Added
* Add static `fromInteger()` method to create UUIDs from string integer or
`Moontoast\Math\BigNumber`
### Fixed
* Improve Doctrine conversion to Uuid or string for the ramsey/uuid [Doctrine field type]
## 2.7.4 - 2014-10-29
### Fixed
* Change loop in `generateBytes()` from `foreach` to `for`
## 2.7.3 - 2014-08-27
### Fixed
* Fix upper range for `mt_rand` used in version 4 UUIDs
## 2.7.2 - 2014-07-28
### Changed
* Upgrade to PSR-4 autoloading
## 2.7.1 - 2014-02-19
### Fixed
* Move moontoast/math and symfony/console to require-dev
* Support symfony/console 2.3 (LTS version)
## 2.7.0 - 2014-01-31
### Added
* Add `Uuid::VALID_PATTERN` constant containing a UUID validation regex pattern
## 2.6.1 - 2014-01-27
### Fixed
* Fix bug where `uuid` console application could not find the Composer
autoloader when installed in another project
## 2.6.0 - 2014-01-17
### Added
* Introduce `uuid` console application for generating and decoding UUIDs from
CLI (run `./bin/uuid` for details)
* Add `Uuid::getInteger()` to retrieve a `Moontoast\Math\BigNumber`
representation of the 128-bit integer representing the UUID
* Add `Uuid::getHex()` to retrieve the hexadecimal representation of the UUID
* Use `netstat` on Linux to capture the node for a version 1 UUID
* Require moontoast/math as part of the regular package requirements
## 2.5.0 - 2013-10-30
### Added
* Use `openssl_random_pseudo_bytes()`, if available, to generate random bytes
## 2.4.0 - 2013-07-29
### Added
* Return `null` from `Uuid::getVersion()` if the UUID isn't an RFC 4122 variant
* Support string UUIDs without dashes passed to `Uuid::fromString()`
## 2.3.0 - 2013-07-16
### Added
* Support creation of UUIDs from bytes with `Uuid::fromBytes()`
## 2.2.0 - 2013-07-04
### Added
* Add `Doctrine\UuidType::requiresSQLCommentHint()` method
## 2.1.2 - 2013-07-03
### Fixed
* Fix cases where the system node was coming back with uppercase hexadecimal
digits; this ensures that case in the node is converted to lowercase
## 2.1.1 - 2013-04-29
### Fixed
* Fix bug in `Uuid::isValid()` where the NIL UUID was not reported as valid
## 2.1.0 - 2013-04-15
### Added
* Allow checking the validity of a UUID through the `Uuid::isValid()` method
## 2.0.0 - 2013-02-11
### Added
* Support UUID generation on 32-bit platforms
### Changed
* Mark `Uuid` class `final`
* Require moontoast/math on 64-bit platforms for
`Uuid::getLeastSignificantBits()` and `Uuid::getMostSignificantBits()`; the
integers returned by these methods are *unsigned* 64-bit integers and
unsupported even on 64-bit builds of PHP
* Move `UnsupportedOperationException` to the `Exception` subnamespace
## 1.1.2 - 2012-11-29
### Fixed
* Relax [Doctrine field type] conversion rules for UUIDs
## 1.1.1 - 2012-08-27
### Fixed
* Remove `final` keyword from `Uuid` class
## 1.1.0 - 2012-08-06
### Added
* Support ramsey/uuid UUIDs as a Doctrine Database Abstraction Layer (DBAL)
field mapping type
## 1.0.0 - 2012-07-19
### Added
* Support generation of version 1, 3, 4, and 5 UUIDs
[comb sequential uuids]: http://www.informit.com/articles/article.aspx?p=25862&seqNum=7
[paragonie/random_compat]: https://github.com/paragonie/random_compat
[collision issue]: https://github.com/ramsey/uuid/issues/80
[contributor code of conduct]: https://github.com/ramsey/uuid/blob/main/CODE_OF_CONDUCT.md
[pecl libsodium extension]: http://pecl.php.net/package/libsodium
[ircmaxell/random-lib]: https://github.com/ircmaxell/RandomLib
[doctrine field type]: http://doctrine-dbal.readthedocs.org/en/latest/reference/types.html
[ramsey/uuid-doctrine]: https://github.com/ramsey/uuid-doctrine
[ramsey/uuid-console]: https://github.com/ramsey/uuid-console
[version6]: https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis-00#section-5.6
[version7]: https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis-00#section-5.7
[version8]: https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis-00#section-5.8
[max uuids]: https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format-04#section-5.4
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project maintainer(s) at <ben@benramsey.com>. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.4, available at <http://contributor-covenant.org/version/1/4>.
[homepage]: http://contributor-covenant.org
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing
Contributions are welcome. This project accepts pull requests on [GitHub][].
This project adheres to a [code of conduct](CODE_OF_CONDUCT.md). By
participating in this project and its community, you are expected to uphold this
code.
## Communication Channels
You can find help and discussion in the following places:
* GitHub Issues: <https://github.com/ramsey/uuid/issues>
## Reporting Bugs
Report bugs using the project's [issue tracker][issues].
⚠️ _**ATTENTION!!!** DO NOT include passwords or other sensitive information in
your bug report._
When submitting a bug report, please include enough information to reproduce the
bug. A good bug report includes the following sections:
* **Description**
Provide a short and clear description of the bug.
* **Steps to reproduce**
Provide steps to reproduce the behavior you are experiencing. Please try to
keep this as short as possible. If able, create a reproducible script outside
of any framework you are using. This will help us to quickly debug the issue.
* **Expected behavior**
Provide a short and clear description of what you expect to happen.
* **Screenshots or output**
If applicable, add screenshots or program output to help explain your problem.
* **Environment details**
Provide details about the system where you're using this package, such as PHP
version and operating system.
* **Additional context**
Provide any additional context that may help us debug the problem.
## Fixing Bugs
This project welcomes pull requests to fix bugs!
If you see a bug report that you'd like to fix, please feel free to do so.
Following the directions and guidelines described in the "Adding New Features"
section below, you may create bugfix branches and send pull requests.
## Adding New Features
If you have an idea for a new feature, it's a good idea to check out the
[issues][] or active [pull requests][] first to see if anyone is already working
on the feature. If not, feel free to submit an issue first, asking whether the
feature is beneficial to the project. This will save you from doing a lot of
development work only to have your feature rejected. We don't enjoy rejecting
your hard work, but some features don't fit with the goals of the project.
When you do begin working on your feature, here are some guidelines to consider:
* Your pull request description should clearly detail the changes you have made.
We will use this description to update the CHANGELOG. If there is no
description, or it does not adequately describe your feature, we may ask you
to update the description.
* ramsey/uuid follows a superset of **[PSR-12 coding standard][psr-12]**.
Please ensure your code does, too. _Hint: run `composer phpcs` to check._
* Please **write tests** for any new features you add.
* Please **ensure that tests pass** before submitting your pull request.
ramsey/uuid automatically runs tests for pull requests. However,
running the tests locally will help save time. _Hint: run `composer test`._
* **Use topic/feature branches.** Please do not ask to pull from your main branch.
* For more information, see "[Understanding the GitHub flow][gh-flow]."
* **Submit one feature per pull request.** If you have multiple features you
wish to submit, please break them into separate pull requests.
## Developing
To develop this project, you will need [PHP](https://www.php.net) 8.0 or greater
and [Composer](https://getcomposer.org).
After cloning this repository locally, execute the following commands:
``` bash
cd /path/to/repository
composer install
```
Now, you are ready to develop!
### Tooling
This project uses [CaptainHook](https://github.com/captainhook-git/captainhook)
to validate all staged changes prior to commit.
### Commands
To see all the commands available for contributing to this project:
``` bash
composer list
```
### Coding Standards
This project follows a superset of [PSR-12](https://www.php-fig.org/psr/psr-12/)
coding standards, enforced by [PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer).
CaptainHook will run coding standards checks before committing.
You may lint the codebase manually using the following commands:
``` bash
# Lint
composer dev:lint
# Attempt to auto-fix coding standards issues
composer dev:lint:fix
```
### Static Analysis
This project uses [PHPStan](https://github.com/phpstan/phpstan) to provide
static analysis of PHP code.
CaptainHook will run static analysis checks before committing.
You may run static analysis manually across the whole codebase with the
following command:
``` bash
# Static analysis
composer dev:analyze
```
### Project Structure
This project uses [pds/skeleton](https://github.com/php-pds/skeleton) as its
base folder structure and layout.
### Running Tests
The following must pass before we will accept a pull request. If this does not
pass, it will result in a complete build failure. Before you can run this, be
sure to `composer install`.
To run all the tests and coding standards checks, execute the following from the
command line, while in the project root directory:
```
composer test
```
CaptainHook will automatically run all tests before pushing to the remote
repository.
[github]: https://github.com/ramsey/uuid
[issues]: https://github.com/ramsey/uuid/issues
[pull requests]: https://github.com/ramsey/uuid/pulls
[psr-12]: https://www.php-fig.org/psr/psr-12/
[gh-flow]: https://guides.github.com/introduction/flow/
================================================
FILE: LICENSE
================================================
Copyright (c) 2012-2025 Ben Ramsey <ben@benramsey.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
<h1 align="center">ramsey/uuid</h1>
<p align="center">
<strong>A PHP library for generating and working with UUIDs.</strong>
</p>
<p align="center">
<a href="https://github.com/ramsey/uuid"><img src="http://img.shields.io/badge/source-ramsey/uuid-blue.svg?style=flat-square" alt="Source Code"></a>
<a href="https://packagist.org/packages/ramsey/uuid"><img src="https://img.shields.io/packagist/v/ramsey/uuid.svg?style=flat-square&label=release" alt="Download Package"></a>
<a href="https://php.net"><img src="https://img.shields.io/packagist/php-v/ramsey/uuid.svg?style=flat-square&colorB=%238892BF" alt="PHP Programming Language"></a>
<a href="https://github.com/ramsey/uuid/blob/4.x/LICENSE"><img src="https://img.shields.io/packagist/l/ramsey/uuid.svg?style=flat-square&colorB=darkcyan" alt="Read License"></a>
<a href="https://github.com/ramsey/uuid/actions/workflows/continuous-integration.yml"><img src="https://img.shields.io/github/actions/workflow/status/ramsey/uuid/continuous-integration.yml?branch=4.x&logo=github&style=flat-square" alt="Build Status"></a>
<a href="https://app.codecov.io/gh/ramsey/uuid/branch/4.x"><img src="https://img.shields.io/codecov/c/github/ramsey/uuid/4.x?label=codecov&logo=codecov&style=flat-square" alt="Codecov Code Coverage"></a>
</p>
ramsey/uuid is a PHP library for generating and working with universally unique
identifiers (UUIDs).
This project adheres to a [code of conduct](CODE_OF_CONDUCT.md).
By participating in this project and its community, you are expected to
uphold this code.
Much inspiration for this library came from the [Java][javauuid] and
[Python][pyuuid] UUID libraries.
## Installation
The preferred method of installation is via [Composer][]. Run the following
command to install the package and add it as a requirement to your project's
`composer.json`:
```bash
composer require ramsey/uuid
```
## Upgrading to Version 4
See the documentation for a thorough upgrade guide:
* [Upgrading ramsey/uuid Version 3 to 4](https://uuid.ramsey.dev/en/stable/upgrading/3-to-4.html)
## Documentation
Please see <https://uuid.ramsey.dev> for documentation, tips, examples, and
frequently asked questions.
## Contributing
Contributions are welcome! To contribute, please familiarize yourself with
[CONTRIBUTING.md](CONTRIBUTING.md).
## Coordinated Disclosure
Keeping user information safe and secure is a top priority, and we welcome the
contribution of external security researchers. If you believe you've found a
security issue in software that is maintained in this repository, please read
[SECURITY.md][] for instructions on submitting a vulnerability report.
## ramsey/uuid for Enterprise
Available as part of the Tidelift Subscription.
The maintainers of ramsey/uuid and thousands of other packages are working with
Tidelift to deliver commercial support and maintenance for the open source
packages you use to build your applications. Save time, reduce risk, and improve
code health, while paying the maintainers of the exact packages you use.
[Learn more.](https://tidelift.com/subscription/pkg/packagist-ramsey-uuid?utm_source=undefined&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
## Copyright and License
The ramsey/uuid library is copyright © [Ben Ramsey](https://benramsey.com/) and
licensed for use under the MIT License (MIT). Please see [LICENSE][] for more
information.
[rfc4122]: http://tools.ietf.org/html/rfc4122
[conduct]: https://github.com/ramsey/uuid/blob/4.x/CODE_OF_CONDUCT.md
[javauuid]: http://docs.oracle.com/javase/6/docs/api/java/util/UUID.html
[pyuuid]: http://docs.python.org/3/library/uuid.html
[composer]: http://getcomposer.org/
[contributing.md]: https://github.com/ramsey/uuid/blob/4.x/CONTRIBUTING.md
[security.md]: https://github.com/ramsey/uuid/blob/4.x/SECURITY.md
[license]: https://github.com/ramsey/uuid/blob/4.x/LICENSE
================================================
FILE: SECURITY.md
================================================
<!--
This policy template was created using the HackerOne Policy Builder [1],
with guidance from the National Telecommunications and Information
Administration Coordinated Vulnerability Disclosure Template [2].
-->
# Vulnerability Disclosure Policy (VDP)
## Brand Promise
<!--
This is your brand promise. Its objective is to "demonstrate a clear, good
faith commitment to customers and other stakeholders potentially impacted by
security vulnerabilities" [2].
-->
Keeping user information safe and secure is a top priority, and we welcome the
contribution of external security researchers.
## Scope
<!--
This is your initial scope. It tells vulnerability finders and reporters
"which systems and capabilities are 'fair game' versus 'off limits'" [2].
For software packages, this is often a list of currently maintained versions
of the package.
-->
If you believe you've found a security issue in software that is maintained in
this repository, we encourage you to notify us.
| Version | In scope | Source code |
| ------------ | -------- |-----------------------------------------|
| latest (4.x) | ✅ | https://github.com/ramsey/uuid/tree/4.x |
| 3.9 | ✅ | https://github.com/ramsey/uuid/tree/3.x |
| 3.8 | ✅ | https://github.com/ramsey/uuid/tree/3.x |
## How to Submit a Report
<!--
This is your communication process. It tells security researchers how to
contact you to report a vulnerability. It may be a link to a web form that
uses HTTPS for secure communication, or it may be an email address.
Optionally, you may choose to include a PGP public key, so that researchers
may send you encrypted messages.
-->
To submit a vulnerability report, please contact us at security@ramsey.dev.
Your submission will be reviewed and validated by a member of our team.
## Safe Harbor
<!--
This section assures vulnerability finders and reporters that they will
receive good faith responses to their good faith acts. In other words,
"we will not take legal action if..." [2].
-->
We support safe harbor for security researchers who:
* Make a good faith effort to avoid privacy violations, destruction of data, and
interruption or degradation of our services.
* Only interact with accounts you own or with explicit permission of the account
holder. If you do encounter Personally Identifiable Information (PII) contact
us immediately, do not proceed with access, and immediately purge any local
information.
* Provide us with a reasonable amount of time to resolve vulnerabilities prior
to any disclosure to the public or a third party.
We will consider activities conducted consistent with this policy to constitute
"authorized" conduct and will not pursue civil action or initiate a complaint to
law enforcement. We will help to the extent we can if legal action is initiated
by a third party against you.
Please submit a report to us before engaging in conduct that may be inconsistent
with or unaddressed by this policy.
## Preferences
<!--
The preferences section sets expectations based on priority and submission
volume, rather than legal objection or restriction [2].
According to the NTIA [2]:
This section is a living document that sets expectations for preferences
and priorities, typically maintained by the support and engineering
team. This can outline classes of vulnerabilities, reporting style
(crash dumps, CVSS scoring, proof-of-concept, etc.), tools, etc. Too
many preferences can set the wrong tone or make reporting findings
difficult to navigate. This section also sets expectations to the
researcher community for what types of issues are considered important
or not.
-->
* Please provide detailed reports with reproducible steps and a clearly defined
impact.
* Include the version number of the vulnerable package in your report
* Social engineering (e.g. phishing, vishing, smishing) is prohibited.
<!--
References
[1] HackerOne. Policy builder. Retrieved from https://hackerone.com/policy-builder/
[2] NTIA Safety Working Group. 2016. "Early stage" coordinated vulnerability
disclosure template: Version 1.1. (15 December 2016). Retrieved from
https://www.ntia.doc.gov/files/ntia/publications/ntia_vuln_disclosure_early_stage_template.pdf
-->
## Encryption Key for security@ramsey.dev
For increased privacy when reporting sensitive issues, you may encrypt your message using the following public key:
```
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBF+Z9gEBEACbT/pIx8RR0K18t8Z2rDnmEV44YdT7HNsMdq+D6SAlx8UUb6AU
jGIbV9dgBgGNtOLU1pxloaJwL9bWIRbj+X/Qb2WNIP//Vz1Y40ox1dSpfCUrizXx
kb4p58Xml0PsB8dg3b4RDUgKwGC37ne5xmDnigyJPbiB2XJ6Xc46oPCjh86XROTK
wEBB2lY67ClBlSlvC2V9KmbTboRQkLdQDhOaUosMb99zRb0EWqDLaFkZVjY5HI7i
0pTveE6dI12NfHhTwKjZ5pUiAZQGlKA6J1dMjY2unxHZkQj5MlMfrLSyJHZxccdJ
xD94T6OTcTHt/XmMpI2AObpewZDdChDQmcYDZXGfAhFoJmbvXsmLMGXKgzKoZ/ls
RmLsQhh7+/r8E+Pn5r+A6Hh4uAc14ApyEP0ckKeIXw1C6pepHM4E8TEXVr/IA6K/
z6jlHORixIFX7iNOnfHh+qwOgZw40D6JnBfEzjFi+T2Cy+JzN2uy7I8UnecTMGo3
5t6astPy6xcH6kZYzFTV7XERR6LIIVyLAiMFd8kF5MbJ8N5ElRFsFHPW+82N2HDX
c60iSaTB85k6R6xd8JIKDiaKE4sSuw2wHFCKq33d/GamYezp1wO+bVUQg88efljC
2JNFyD+vl30josqhw1HcmbE1TP3DlYeIL5jQOlxCMsgai6JtTfHFM/5MYwARAQAB
tBNzZWN1cml0eUByYW1zZXkuZGV2iQJUBBMBCAA+FiEE4drPD+/ofZ570fAYq0bv
vXQCywIFAl+Z9gECGwMFCQeGH4AFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQ
q0bvvXQCywIkEA//Qcwv8MtTCy01LHZd9c7VslwhNdXQDYymcTyjcYw8x7O22m4B
3hXE6vqAplFhVxxkqXB2ef0tQuzxhPHNJgkCE4Wq4i+V6qGpaSVHQT2W6DN/NIhL
vS8OdScc6zddmIbIkSrzVVAtjwehFNEIrX3DnbbbK+Iku7vsKT5EclOluIsjlYoX
goW8IeReyDBqOe2H3hoCGw6EA0D/NYV2bJnfy53rXVIyarsXXeOLp7eNEH6Td7aW
PVSrMZJe1t+knrEGnEdrXWzlg4lCJJCtemGv+pKBUomnyISXSdqyoRCCzvQjqyig
2kRebUX8BXPW33p4OXPj9sIboUOjZwormWwqqbFMO+J4TiVCUoEoheI7emPFRcNN
QtPJrjbY1++OznBc0GRpfeUkGoU1cbRl1bnepnFIZMTDLkrVW6I1Y4q8ZVwX3BkE
N81ctFrRpHBlU36EdHvjPQmGtuiL77Qq3fWmMv7yTvK1wHJAXfEb0ZJWHZCbck3w
l0CVq0Z+UUAOM8Rp1N0N8m92xtapav0qCFU9qzf2J5qX6GRmWv+d29wPgFHzDWBm
nnrYYIA4wJLx00U6SMcVBSnNe91B+RfGY5XQhbWPjQQecOGCSDsxaFAq2MeOVJyZ
bIjLYfG9GxoLKr5R7oLRJvZI4nKKBc1Kci/crZbdiSdQhSQGlDz88F1OHeCIdQQQ
EQgAHRYhBOhdAxHd+lus86YQ57Atl5icjAcbBQJfmfdIAAoJELAtl5icjAcbFVcA
/1LqB3ZjsnXDAvvAXZVjSPqofSlpMLeRQP6IM/A9Odq0AQCZrtZc1knOMGEcjppK
Rk+sy/R0Mshy8TDuaZIRgh2Ux7kCDQRfmfYBARAAmchKzzVz7IaEq7PnZDb3szQs
T/+E9F3m39yOpV4fEB1YzObonFakXNT7Gw2tZEx0eitUMqQ/13jjfu3UdzlKl2bR
qA8LrSQRhB+PTC9A1XvwxCUYhhjGiLzJ9CZL6hBQB43qHOmE9XJPme90geLsF+gK
u39Waj1SNWzwGg+Gy1Gl5f2AJoDTxznreCuFGj+Vfaczt/hlfgqpOdb9jsmdoE7t
3DSWppA9dRHWwQSgE6J28rR4QySBcqyXS6IMykqaJn7Z26yNIaITLnHCZOSY8zhP
ha7GFsN549EOCgECbrnPt9dmI2+hQE0RO0e7SOBNsIf5sz/i7urhwuj0CbOqhjc2
X1AEVNFCVcb6HPi/AWefdFCRu0gaWQxn5g+9nkq5slEgvzCCiKYzaBIcr8qR6Hb4
FaOPVPxO8vndRouq57Ws8XpAwbPttioFuCqF4u9K+tK/8e2/R8QgRYJsE3Cz/Fu8
+pZFpMnqbDEbK3DL3ss+1ed1sky+mDV8qXXeI33XW5hMFnk1JWshUjHNlQmE6ftC
U0xSTMVUtwJhzH2zDp8lEdu7qi3EsNULOl68ozDr6soWAvCbHPeTdTOnFySGCleG
/3TonsoZJs/sSPPJnxFQ1DtgQL6EbhIwa0ZwU4eKYVHZ9tjxuMX3teFzRvOrJjgs
+ywGlsIURtEckT5Y6nMAEQEAAYkCPAQYAQgAJhYhBOHazw/v6H2ee9HwGKtG7710
AssCBQJfmfYBAhsMBQkHhh+AAAoJEKtG7710AssC8NcP/iDAcy1aZFvkA0EbZ85p
i7/+ywtE/1wF4U4/9OuLcoskqGGnl1pJNPooMOSBCfreoTB8HimT0Fln0CoaOm4Q
pScNq39JXmf4VxauqUJVARByP6zUfgYarqoaZNeuFF0S4AZJ2HhGzaQPjDz1uKVM
PE6tQSgQkFzdZ9AtRA4vElTH6yRAgmepUsOihk0b0gUtVnwtRYZ8e0Qt3ie97a73
DxLgAgedFRUbLRYiT0vNaYbainBsLWKpN/T8odwIg/smP0Khjp/ckV60cZTdBiPR
szBTPJESMUTu0VPntc4gWwGsmhZJg/Tt/qP08XYo3VxNYBegyuWwNR66zDWvwvGH
muMv5UchuDxp6Rt3JkIO4voMT1JSjWy9p8krkPEE4V6PxAagLjdZSkt92wVLiK5x
y5gNrtPhU45YdRAKHr36OvJBJQ42CDaZ6nzrzghcIp9CZ7ANHrI+QLRM/csz+AGA
szSp6S4mc1lnxxfbOhPPpebZPn0nIAXoZnnoVKdrxBVedPQHT59ZFvKTQ9Fs7gd3
sYNuc7tJGFGC2CxBH4ANDpOQkc5q9JJ1HSGrXU3juxIiRgfA26Q22S9c71dXjElw
Ri584QH+bL6kkYmm8xpKF6TVwhwu5xx/jBPrbWqFrtbvLNrnfPoapTihBfdIhkT6
nmgawbBHA02D5xEqB5SU3WJu
=eJNx
-----END PGP PUBLIC KEY BLOCK-----
```
================================================
FILE: build/.gitignore
================================================
*
!.gitignore
!cache
!cache/.gitkeep
!logs
!logs/.gitkeep
================================================
FILE: build/cache/.gitkeep
================================================
================================================
FILE: build/logs/.gitkeep
================================================
================================================
FILE: captainhook.json
================================================
{
"config": {
"ansi-colors": true,
"fail-on-first-error": false,
"plugins": [],
"verbosity": "normal"
},
"commit-msg": {
"enabled": false,
"actions": []
},
"pre-push": {
"enabled": true,
"actions": [
{
"action": "composer test"
}
]
},
"pre-commit": {
"enabled": true,
"actions": [
{
"action": "composer validate",
"conditions": [
{
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileStaged\\Any",
"args": [["composer.json"]]
}
]
},
{
"action": "composer normalize --dry-run",
"conditions": [
{
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileStaged\\Any",
"args": [["composer.json"]]
}
]
},
{
"action": "composer dev:lint:syntax -- {$STAGED_FILES|of-type:php}",
"conditions": [
{
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileStaged\\OfType",
"args": ["php"]
}
]
},
{
"action": "composer dev:lint:style -- {$STAGED_FILES|of-type:php}",
"conditions": [
{
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileStaged\\OfType",
"args": ["php"]
}
]
}
]
},
"prepare-commit-msg": {
"enabled": false,
"actions": []
},
"post-commit": {
"enabled": false,
"actions": []
},
"post-merge": {
"enabled": true,
"actions": [
{
"action": "composer install --ansi",
"conditions": [
{
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileChanged\\Any",
"args": [["composer.json", "composer.lock"]]
}
]
}
]
},
"post-checkout": {
"enabled": true,
"actions": [
{
"action": "composer install --ansi",
"conditions": [
{
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileChanged\\Any",
"args": [["composer.json", "composer.lock"]]
}
]
}
]
},
"post-rewrite": {
"enabled": false,
"actions": []
},
"post-change": {
"enabled": false,
"actions": []
}
}
================================================
FILE: codecov.yml
================================================
codecov:
require_ci_to_pass: yes
coverage:
precision: 2
round: down
range: "70...100"
status:
project:
default:
target: auto
threshold: 0%
patch:
default:
target: auto
threshold: 0%
parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no
comment:
layout: "reach,diff,flags,tree"
behavior: default
require_changes: false
================================================
FILE: composer.json
================================================
{
"name": "ramsey/uuid",
"description": "A PHP library for generating and working with universally unique identifiers (UUIDs).",
"license": "MIT",
"type": "library",
"keywords": [
"uuid",
"identifier",
"guid"
],
"require": {
"php": "^8.0",
"brick/math": "^0.8.16 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13 || ^0.14",
"ramsey/collection": "^1.2 || ^2.0"
},
"require-dev": {
"captainhook/captainhook": "^5.25",
"captainhook/plugin-composer": "^5.3",
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
"ergebnis/composer-normalize": "^2.47",
"mockery/mockery": "^1.6",
"paragonie/random-lib": "^2",
"php-mock/php-mock": "^2.6",
"php-mock/php-mock-mockery": "^1.5",
"php-parallel-lint/php-parallel-lint": "^1.4.0",
"phpbench/phpbench": "^1.2.14",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^2.1",
"phpstan/phpstan-mockery": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
"phpunit/phpunit": "^9.6",
"slevomat/coding-standard": "^8.18",
"squizlabs/php_codesniffer": "^3.13"
},
"replace": {
"rhumsaa/uuid": "self.version"
},
"suggest": {
"ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.",
"ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.",
"ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.",
"paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter",
"ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type."
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": {
"Ramsey\\Uuid\\": "src/"
},
"files": [
"src/functions.php"
]
},
"autoload-dev": {
"psr-4": {
"Ramsey\\Uuid\\Benchmark\\": "tests/benchmark/",
"Ramsey\\Uuid\\StaticAnalysis\\": "tests/static-analysis/",
"Ramsey\\Uuid\\Test\\": "tests/"
}
},
"config": {
"allow-plugins": {
"captainhook/plugin-composer": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"ergebnis/composer-normalize": true,
"phpstan/extension-installer": true
},
"sort-packages": true
},
"extra": {
"captainhook": {
"force-install": true
}
},
"scripts": {
"dev:analyze": "@dev:analyze:phpstan",
"dev:analyze:phpstan": "phpstan analyse --ansi --memory-limit 1G",
"dev:bench": "@php -d 'error_reporting=24575' vendor/bin/phpbench run",
"dev:build:clean": "git clean -fX build/",
"dev:lint": [
"@dev:lint:syntax",
"@dev:lint:style"
],
"dev:lint:fix": "phpcbf --cache=build/cache/phpcs.cache",
"dev:lint:style": "phpcs --cache=build/cache/phpcs.cache --colors",
"dev:lint:syntax": "parallel-lint --colors src/ tests/",
"dev:test": [
"@dev:lint",
"@dev:bench",
"@dev:analyze",
"@dev:test:unit"
],
"dev:test:coverage:ci": "@php -d 'xdebug.mode=coverage' vendor/bin/phpunit --colors=always --coverage-text --coverage-clover build/coverage/clover.xml --coverage-cobertura build/coverage/cobertura.xml --coverage-crap4j build/coverage/crap4j.xml --coverage-xml build/coverage/coverage-xml --log-junit build/junit.xml",
"dev:test:coverage:html": "@php -d 'xdebug.mode=coverage' vendor/bin/phpunit --colors=always --coverage-html build/coverage/coverage-html/",
"dev:test:unit": "phpunit --colors=always",
"test": "@dev:test"
},
"scripts-descriptions": {
"dev:analyze": "Runs all static analysis checks.",
"dev:analyze:phpstan": "Runs the PHPStan static analyzer.",
"dev:bench": "Runs PHPBench benchmark tests.",
"dev:build:clean": "Cleans the build/ directory.",
"dev:lint": "Runs all linting checks.",
"dev:lint:fix": "Auto-fixes coding standards issues, if possible.",
"dev:lint:style": "Checks for coding standards issues.",
"dev:lint:syntax": "Checks for syntax errors.",
"dev:test": "Runs linting, static analysis, and unit tests.",
"dev:test:coverage:ci": "Runs unit tests and generates CI coverage reports.",
"dev:test:coverage:html": "Runs unit tests and generates HTML coverage report.",
"dev:test:unit": "Runs unit tests.",
"test": "Runs linting, static analysis, and unit tests."
}
}
================================================
FILE: docs/.gitignore
================================================
_build/
================================================
FILE: docs/LICENSE
================================================
Attribution 4.0 International
=======================================================================
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are
intended for use by those authorized to give the public
permission to use material in ways otherwise restricted by
copyright and certain other rights. Our licenses are
irrevocable. Licensors should read and understand the terms
and conditions of the license they choose before applying it.
Licensors should also secure all rights necessary before
applying our licenses so that the public can reuse the
material as expected. Licensors should clearly mark any
material not subject to the license. This includes other CC-
licensed material, or material used under an exception or
limitation to copyright. More considerations for licensors:
wiki.creativecommons.org/Considerations_for_licensors
Considerations for the public: By using one of our public
licenses, a licensor grants the public permission to use the
licensed material under specified terms and conditions. If
the licensor's permission is not necessary for any reason--for
example, because of any applicable exception or limitation to
copyright--then that use is not regulated by the license. Our
licenses grant only permissions under copyright and certain
other rights that a licensor has authority to grant. Use of
the licensed material may still be restricted for other
reasons, including because others have copyright or other
rights in the material. A licensor may make special requests,
such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More considerations
for the public:
wiki.creativecommons.org/Considerations_for_licensees
=======================================================================
Creative Commons Attribution 4.0 International Public License
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution 4.0 International Public License ("Public License"). To the
extent this Public License may be interpreted as a contract, You are
granted the Licensed Rights in consideration of Your acceptance of
these terms and conditions, and the Licensor grants You such rights in
consideration of benefits the Licensor receives from making the
Licensed Material available under these terms and conditions.
Section 1 -- Definitions.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright
and Similar Rights in Your contributions to Adapted Material in
accordance with the terms and conditions of this Public License.
c. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
d. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
e. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
f. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.
g. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.
h. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
i. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.
j. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
k. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
Section 2 -- Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or
in part; and
b. produce, reproduce, and Share Adapted Material.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.
3. Term. The term of this Public License is specified in Section
6(a).
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.
b. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this
Public License.
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified
form), You must:
a. retain the following if it is supplied by the Licensor
with the Licensed Material:
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of
warranties;
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
4. If You Share Adapted Material You produce, the Adapter's
License You apply must not prevent recipients of the Adapted
Material from complying with this Public License.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material; and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.
=======================================================================
Creative Commons is not a party to its public
licenses. Notwithstanding, Creative Commons may elect to apply one of
its public licenses to material it publishes and in those instances
will be considered the “Licensor.” The text of the Creative Commons
public licenses is dedicated to the public domain under the CC0 Public
Domain Dedication. Except for the limited purpose of indicating that
material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the
public licenses.
Creative Commons may be contacted at creativecommons.org.
================================================
FILE: docs/Makefile
================================================
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
================================================
FILE: docs/README.md
================================================
# ramsey/uuid Documentation
Changes to the documentation are automatically built by [Read the Docs][] and viewable from <https://uuid.ramsey.dev>.
## Getting Started
It's probably best to do this in a virtualenv environment, so set one up first:
``` bash
pip install virtualenvwrapper
mkvirtualenv ramsey-uuid-docs
cd docs/
workon ramsey-uuid-docs
pip install -r requirements.txt
```
## Building the Docs
To build the docs, change to the `docs/` directory, and make sure you're working on the virtualenv environment created
in the last step.
``` bash
cd docs/
workon ramsey-uuid-docs
make html
```
Then, to view the docs after building them:
``` bash
open _build/html/index.html
```
[read the docs]: https://readthedocs.org
================================================
FILE: docs/_static/.gitkeep
================================================
================================================
FILE: docs/conf.py
================================================
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
import os
import sphinx_rtd_theme
import sys
import datetime
from pygments.lexers.web import PhpLexer
from sphinx.highlighting import lexers
from subprocess import Popen, PIPE
def get_version():
if os.environ.get('READTHEDOCS') == 'True':
return os.environ.get('READTHEDOCS_VERSION')
pipe = Popen('git branch | grep \\*', stdout=PIPE, shell=True, universal_newlines=True)
version = pipe.stdout.read()
if version:
return version[2:]
else:
return 'unknown'
# -- Project information -----------------------------------------------------
project = 'ramsey/uuid'
copyright = '2012-{year}, Ben Ramsey'.format(year = datetime.date.today().strftime('%Y'))
author = 'Ben Ramsey'
version = get_version().strip()
release = version
today = datetime.date.today().strftime('%Y-%m-%d')
# -- General configuration ---------------------------------------------------
master_doc = 'index'
highlight_language = 'php'
# enable highlighting for PHP code not between ``<?php ... ?>`` by default
lexers['php'] = PhpLexer(startinline=True)
lexers['php-annotations'] = PhpLexer(startinline=True)
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinxcontrib.phpdomain',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
pygments_style = 'sphinx'
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
html_theme_options = {
'collapse_navigation': False,
'display_version': False
}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_title = "ramsey/uuid %s Manual" % get_version()
html_show_sphinx = False
htmlhelp_basename = 'ramsey-uuid-doc'
html_context = {
"display_github": True,
"github_user": "ramsey",
"github_repo": "uuid",
"github_version": version,
"conf_py_path": "/docs/",
}
current_year = datetime.date.today().strftime('%Y')
rst_prolog = """
.. |current_year| replace:: {0}
""".format(current_year)
================================================
FILE: docs/copyright.rst
================================================
.. _copyright:
=========
Copyright
=========
Copyright © 2012-|current_year| `Ben Ramsey <https://benramsey.com>`_ and
`contributors <https://github.com/ramsey/uuid/contributors>`_.
Documentation for ramsey/uuid is licensed under the Creative Commons Attribution 4.0 International License. To view a
copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send a letter to Creative Commons, PO Box
1866, Mountain View, CA 94042, USA.
ramsey/uuid is open source software: you can distribute it and/or modify it under the terms of the MIT License (the
"License"). You may not use ramsey/uuid except in compliance with the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License.
You should have received a copy of the MIT License along with this program. If not, see
https://opensource.org/license/mit/.
================================================
FILE: docs/customize/calculators.rst
================================================
.. _customize.calculators:
=========================
Using a Custom Calculator
=========================
By default, ramsey/uuid uses `brick/math`_ as its internal calculator. However, you may change the calculator, if your
needs require something else.
To swap the default calculator with your custom one, first make an adapter that wraps your custom calculator and
implements :php:interface:`Ramsey\\Uuid\\Math\\CalculatorInterface`. This might look something like this:
.. code-block:: php
:caption: Create a custom calculator wrapper that implements CalculatorInterface
:name: customize.calculators.wrapper-example
namespace MyProject;
use Other\OtherCalculator;
use Ramsey\Uuid\Math\CalculatorInterface;
use Ramsey\Uuid\Type\Integer as IntegerObject;
use Ramsey\Uuid\Type\NumberInterface;
class MyUuidCalculator implements CalculatorInterface
{
private $internalCalculator;
public function __construct(OtherCalculator $customCalculator)
{
$this->internalCalculator = $customCalculator;
}
public function add(NumberInterface $augend, NumberInterface ...$addends): NumberInterface
{
$value = $augend->toString();
foreach ($addends as $addend) {
$value = $this->internalCalculator->plus($value, $addend->toString());
}
return new IntegerObject($value);
}
/* ... Class truncated for brevity ... */
}
The easiest way to use your custom calculator wrapper is to instantiate a new FeatureSet, set the calculator on it, and
pass the FeatureSet into a new UuidFactory. Using the factory, you may then generate and work with UUIDs, using your
custom calculator.
.. code-block:: php
:caption: Use your custom calculator wrapper when working with UUIDs
:name: customize.calculators.use-wrapper-example
use MyProject\MyUuidCalculator;
use Other\OtherCalculator;
use Ramsey\Uuid\FeatureSet;
use Ramsey\Uuid\UuidFactory;
$otherCalculator = new OtherCalculator();
$myUuidCalculator = new MyUuidCalculator($otherCalculator);
$featureSet = new FeatureSet();
$featureSet->setCalculator($myUuidCalculator);
$factory = new UuidFactory($featureSet);
$uuid = $factory->uuid1();
.. _brick/math: https://github.com/brick/math
================================================
FILE: docs/customize/factory.rst
================================================
.. _customize.factory:
===========================
Replace the Default Factory
===========================
In many of the examples throughout this documentation, we've seen how to configure the factory and then use that factory
to generate and work with UUIDs.
For example:
.. code-block:: php
:caption: Configure the factory and use it to generate a version 1 UUID
:name: customize.factory.example
use Ramsey\Uuid\Codec\OrderedTimeCodec;
use Ramsey\Uuid\UuidFactory;
$factory = new UuidFactory();
$codec = new OrderedTimeCodec($factory->getUuidBuilder());
$factory->setCodec($codec);
$orderedTimeUuid = $factory->uuid1();
When doing this, the default behavior of ramsey/uuid is left intact. If we call ``Uuid::uuid1()`` to generate a version
1 UUID after configuring the factory as shown above, it won't use :ref:`OrderedTimeCodec <customize.ordered-time-codec>`
to generate the UUID.
.. code-block:: php
:caption: The behavior differs between $factory->uuid1() and Uuid::uuid1()
:name: customize.factory.behavior-example
$orderedTimeUuid = $factory->uuid1();
printf(
"UUID: %s\nBytes: %s\n\n",
$orderedTimeUuid->toString(),
bin2hex($orderedTimeUuid->getBytes())
);
$uuid = Uuid::uuid1();
printf(
"UUID: %s\nBytes: %s\n\n",
$uuid->toString(),
bin2hex($uuid->getBytes())
);
In this example, we print out details for two different UUIDs. The first was generated with the :ref:`OrderedTimeCodec
<customize.ordered-time-codec>` using ``$factory->uuid1()``. The second was generated using ``Uuid::uuid1()``. It looks
something like this:
.. code-block:: text
UUID: 2ff06620-6251-11ea-9791-0242ac130003
Bytes: 11ea62512ff0662097910242ac130003
UUID: 2ff09730-6251-11ea-ba64-0242ac130003
Bytes: 2ff09730625111eaba640242ac130003
Notice the arrangement of the bytes. The first set of bytes has been rearranged, according to the ordered-time codec
rules, but the second set of bytes remains in the same order as the UUID string.
*Configuring the factory does not change the default behavior.*
If we want to change the default behavior, we must *replace* the factory used by the Uuid static methods, and we can do
this using the :php:meth:`Uuid::setFactory() <Ramsey\\Uuid\\Uuid::setFactory>` static method.
.. code-block:: php
:caption: Replace the factory to globally affect Uuid behavior
:name: customize.factory.replace-factory-example
Uuid::setFactory($factory);
$uuid = Uuid::uuid1();
Now, every time we call :php:meth:`Uuid::uuid() <Ramsey\\Uuid\\Uuid::uuid1>`, ramsey/uuid will use the factory configured
with the :ref:`OrderedTimeCodec <customize.ordered-time-codec>` to generate version 1 UUIDs.
.. warning::
Calling :php:meth:`Uuid::setFactory() <Ramsey\\Uuid\\Uuid::setFactory>` to replace the factory will change the
behavior of Uuid no matter where it is used, so keep this in mind when replacing the factory. If you replace the
factory deep inside a method somewhere, any later code that calls a static method on :php:class:`Ramsey\\Uuid\\Uuid`
will use the new factory to generate UUIDs.
================================================
FILE: docs/customize/ordered-time-codec.rst
================================================
.. _customize.ordered-time-codec:
==================
Ordered-time Codec
==================
.. attention::
The :php:class:`Ramsey\\Uuid\\Codec\\OrderedTimeCodec` class is deprecated. Please migrate to
:ref:`version 6, reordered Gregorian time UUIDs <rfc4122.version6>`.
UUIDs arrange their bytes according to the standard recommended by `RFC 9562`_ (formerly `RFC 4122`_). Unfortunately,
this means the bytes aren't in an arrangement that supports sorting by creation time or an otherwise incrementing value.
The Percona article, "`Storing UUID Values in MySQL`_," explains at length the problems this can cause. It also
recommends a solution: the *ordered-time UUID*.
`RFC 9562 version 1, Gregorian time UUIDs <https://www.rfc-editor.org/rfc/rfc9562#section-5.1>`_ rearrange the bytes of
the time fields so that the lowest bytes appear first, the middle bytes are next, and the highest bytes come last.
Logical sorting is not possible with this arrangement.
An ordered-time UUID is a version 1 UUID with the time fields arranged in logical order so that the UUIDs can be sorted
by creation time. These UUIDs are *monotonically increasing*, each one coming after the previously-created one, in a
proper sort order.
.. code-block:: php
:caption: Use the ordered-time codec to generate a version 1 UUID
:name: customize.ordered-time-codec-example
use Ramsey\Uuid\Codec\OrderedTimeCodec;
use Ramsey\Uuid\UuidFactory;
$factory = new UuidFactory();
$codec = new OrderedTimeCodec($factory->getUuidBuilder());
$factory->setCodec($codec);
$orderedTimeUuid = $factory->uuid1();
printf(
"UUID: %s\nVersion: %d\nDate: %s\nNode: %s\nBytes: %s\n",
$orderedTimeUuid->toString(),
$orderedTimeUuid->getFields()->getVersion(),
$orderedTimeUuid->getDateTime()->format('r'),
$orderedTimeUuid->getFields()->getNode()->toString(),
bin2hex($orderedTimeUuid->getBytes())
);
This will use the ordered-time codec to generate a version 1 UUID and will print out details about the UUID similar to these:
.. code-block:: text
UUID: 593200aa-61ae-11ea-bbf2-0242ac130003
Version: 1
Date: Mon, 09 Mar 2020 02:33:23 +0000
Node: 0242ac130003
Bytes: 11ea61ae593200aabbf20242ac130003
.. attention::
Only the byte representation is rearranged. The string representation follows the format of a standard version 1
UUID. This means only the byte representation of an ordered-time codec encoded UUID may be used for sorting, such as
with database results.
To store the byte representation to a database field, see :ref:`database.bytes`.
.. hint::
If you use this codec and store the bytes of the UUID to the database, as recommended above, you will need to use
this codec to decode the bytes, as well. Otherwise, the UUID string value will be incorrect.
.. code-block:: php
// Using a factory configured with the OrderedTimeCodec, as shown above.
$orderedTimeUuid = $factory->fromBytes($bytes);
.. _RFC 4122: https://www.rfc-editor.org/rfc/rfc4122
.. _RFC 9562: https://www.rfc-editor.org/rfc/rfc9562
.. _Storing UUID Values in MySQL: https://www.percona.com/blog/store-uuid-optimized-way/
================================================
FILE: docs/customize/timestamp-first-comb-codec.rst
================================================
.. _customize.timestamp-first-comb-codec:
==========================
Timestamp-first COMB Codec
==========================
.. attention::
The :php:class:`Ramsey\\Uuid\\Codec\\TimestampFirstCombCodec` class is deprecated. Please migrate to
:ref:`version 7, Unix Epoch time UUIDs <rfc4122.version7>`.
:ref:`Version 4, random UUIDs <rfc4122.version4>` are doubly problematic when it comes to sorting and storing to
databases (see :ref:`database.order`), since their values are random, and there is no timestamp associated with them
that may be rearranged, like with the :ref:`ordered-time codec <customize.ordered-time-codec>`. In 2002, Jimmy Nilsson
recognized this problem with random UUIDs and proposed a solution he called "COMBs" (see "`The Cost of GUIDs as Primary
Keys`_").
So-called because they *combine* random bytes with a timestamp, the timestamp-first COMB codec replaces the first 48
bits of a version 4, random UUID with a Unix timestamp and microseconds, creating an identifier that can be sorted by
creation time. These UUIDs are *monotonically increasing*, each one coming after the previously-created one, in a proper
sort order.
.. code-block:: php
:caption: Use the timestamp-first COMB codec to generate a version 4 UUID
:name: customize.timestamp-first-comb-codec-example
use Ramsey\Uuid\Codec\TimestampFirstCombCodec;
use Ramsey\Uuid\Generator\CombGenerator;
use Ramsey\Uuid\UuidFactory;
$factory = new UuidFactory();
$codec = new TimestampFirstCombCodec($factory->getUuidBuilder());
$factory->setCodec($codec);
$factory->setRandomGenerator(new CombGenerator(
$factory->getRandomGenerator(),
$factory->getNumberConverter()
));
$timestampFirstComb = $factory->uuid4();
printf(
"UUID: %s\nVersion: %d\nBytes: %s\n",
$timestampFirstComb->toString(),
$timestampFirstComb->getFields()->getVersion(),
bin2hex($timestampFirstComb->getBytes())
);
This will use the timestamp-first COMB codec to generate a version 4 UUID with the timestamp replacing the first 48 bits
and will print out details about the UUID similar to these:
.. code-block:: text
UUID: 9009ebcc-cd99-4b5f-90cf-9155607d2de9
Version: 4
Bytes: 9009ebcccd994b5f90cf9155607d2de9
Note that the bytes are in the same order as the string representation. Unlike the :ref:`ordered-time codec
<customize.ordered-time-codec>`, the timestamp-first COMB codec affects both the string representation and the byte
representation. This means either the string UUID or the bytes may be stored to a datastore and sorted. To learn more,
see :ref:`database`.
.. _The Cost of GUIDs as Primary Keys: https://web.archive.org/web/20240118030355/https://www.informit.com/articles/printerfriendly/25862
================================================
FILE: docs/customize/validators.rst
================================================
.. _customize.validators:
========================
Using a Custom Validator
========================
By default, ramsey/uuid validates UUID strings with the lenient validator :php:class:`Ramsey\\Uuid\\Validator\\GenericValidator`.
This validator ensures the string is 36 characters, has the dashes in the correct places, and uses only hexadecimal
values. It does not ensure the string is of the `RFC 9562`_ (formerly `RFC 4122`_) variant or contains a valid version.
The validator :php:class:`Ramsey\\Uuid\\Rfc4122\\Validator` validates UUID strings to ensure they match the `RFC 9562`_
(formerly `RFC 4122`_) variant and contain a valid version. Since it is not enabled by default, you will need to
configure ramsey/uuid to use it, if you want stricter validation.
.. code-block:: php
:caption: Set an alternate validator to use for Uuid::isValid()
:name: customize.validators-example
use Ramsey\Uuid\Rfc4122\Validator as Rfc4122Validator;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\UuidFactory;
$factory = new UuidFactory();
$factory->setValidator(new Rfc4122Validator());
Uuid::setFactory($factory);
if (!Uuid::isValid('2bfb5006-087b-9553-5082-e8f39337ad29')) {
echo "This UUID is not valid!\n";
}
.. tip::
If you want to use your own validation, create a class that implements :php:interface:`Ramsey\\Uuid\\Validator\\ValidatorInterface`
and use the same method to set your validator on the factory.
.. _RFC 4122: https://www.rfc-editor.org/rfc/rfc4122
.. _RFC 9562: https://www.rfc-editor.org/rfc/rfc9562
================================================
FILE: docs/customize.rst
================================================
.. _customize:
=============
Customization
=============
.. toctree::
:titlesonly:
:hidden:
customize/ordered-time-codec
customize/timestamp-first-comb-codec
customize/calculators
customize/validators
customize/factory
ramsey/uuid offers a variety of ways to modify the standard behavior of the library through dependency injection. Using
`FeatureSet`_, `UuidFactory`_, and :php:meth:`Uuid::setFactory() <Ramsey\\Uuid\\Uuid::setFactory()>`, you are able to
replace just about any `builder`_, `codec`_, `converter`_, `generator`_, `provider`_, and more.
Ordered-time Codec *(deprecated)*
The ordered-time codec exists to rearrange the bytes of a version 1, Gregorian time UUID so that the timestamp
portion of the UUID is monotonically increasing. To learn more, see :ref:`customize.ordered-time-codec`.
Timestamp-first COMB Codec *(deprecated)*
The timestamp-first COMB codec replaces part of a version 4, random UUID with a timestamp, so that the UUID becomes
monotonically increasing. To learn more, see :ref:`customize.timestamp-first-comb-codec`.
Using a Custom Calculator
It's possible to replace the default calculator ramsey/uuid uses. If your requirements require a different solution
for making calculations, see :ref:`customize.calculators`.
Using a Custom Validator
If your requirements require a different level of validation or a different UUID format, you may replace the default
validator. See :ref:`customize.validators`, to learn more.
Replace the Default Factory
Not only are you able to inject alternate builders, codecs, etc. into the factory and use the factory to generate
UUIDs, you may also replace the global, static factory used by the static methods on the Uuid class. To find out
how, see :ref:`customize.factory`.
.. _UuidFactory: https://github.com/ramsey/uuid/blob/4.x/src/UuidFactory.php
.. _FeatureSet: https://github.com/ramsey/uuid/blob/4.x/src/FeatureSet.php
.. _codec: https://github.com/ramsey/uuid/tree/4.x/src/Codec
.. _builder: https://github.com/ramsey/uuid/tree/4.x/src/Builder
.. _converter: https://github.com/ramsey/uuid/tree/4.x/src/Converter
.. _provider: https://github.com/ramsey/uuid/tree/4.x/src/Provider
.. _generator: https://github.com/ramsey/uuid/tree/4.x/src/Generator
================================================
FILE: docs/database.rst
================================================
.. _database:
===================
Using In a Database
===================
.. tip::
`ramsey/uuid-doctrine`_ allows the use of ramsey/uuid as a `Doctrine field type`_. If you use Doctrine, it's a great
option for working with UUIDs and databases.
There are several strategies to consider when working with UUIDs in a database. Among these are whether to store the
string representation or bytes and whether the UUID column should be treated as a primary key. We'll discuss a few of
these approaches here, but the final decision on how to use UUIDs in a database is up to you since your needs will be
different from those of others.
.. note::
All database code examples in this section assume the use of `MariaDB`_ and `PHP Data Objects (PDO)`_. If using a
different database engine or connection library, your code will differ, but the general concepts should remain the
same.
.. _database.string:
Storing As a String
###################
Perhaps the easiest way to store a UUID to a database is to create a ``char(36)`` column and store the UUID as a string.
When stored as a string, UUIDs require no special treatment in SQL statements or when displaying them.
The primary drawback is the size. At 36 characters, UUIDs can take up a lot of space, and when handling a lot of data,
this can add up.
.. code-block:: sql
:caption: Create a table with a column for UUIDs
:name: database.uuid-column-example
CREATE TABLE `notes` (
`uuid` char(36) NOT NULL,
`notes` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Using this database table, we can store the string UUID using code similar to this (assume some of the variables in this
example have been set beforehand):
.. code-block:: php
:caption: Store a string UUID to the uuid column
:name: database.uuid-column-store-example
use Ramsey\Uuid\Uuid;
$uuid = Uuid::uuid4();
$dbh = new PDO($dsn, $username, $password);
$sth = $dbh->prepare('
INSERT INTO notes (
uuid,
notes
) VALUES (
:uuid,
:notes
)
');
$sth->execute([
':uuid' => $uuid->toString(),
':notes' => $notes,
]);
.. _database.bytes:
Storing As Bytes
################
In :ref:`the previous example <database.uuid-column-store-example>`, we saw how to store the string representation of a
UUID to a ``char(36)`` column. As discussed, the primary drawback is the size. However, if we store the UUID in byte
form, we only need a ``char(16)`` column, saving over half the space.
The primary drawback with this approach is ease-of-use. Since the UUID bytes are stored in the database, querying and
selecting data becomes more difficult.
.. code-block:: sql
:caption: Create a table with a column for UUID bytes
:name: database.uuid-bytes-example
CREATE TABLE `notes` (
`uuid` char(16) NOT NULL,
`notes` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Using this database table, we can store the UUID bytes using code similar to this (again, assume some of the variables
in this example have been set beforehand):
.. code-block:: php
:caption: Store UUID bytes to the uuid column
:name: database.uuid-bytes-store-example
$sth->execute([
':uuid' => $uuid->getBytes(),
':notes' => $notes,
]);
Now, when we ``SELECT`` the records from the database, we will need to convert the ``notes.uuid`` column to a
ramsey/uuid object, so that we are able to use it.
.. code-block:: php
:caption: Covert database UUID bytes to UuidInterface instance
:name: database.uuid-bytes-convert-example
use Ramsey\Uuid\Uuid;
$uuid = Uuid::uuid4();
$dbh = new PDO($dsn, $username, $password);
$sth = $dbh->prepare('SELECT uuid, notes FROM notes');
$sth->execute();
foreach ($sth->fetchAll() as $record) {
$uuid = Uuid::fromBytes($record['uuid']);
printf(
"UUID: %s\nNotes: %s\n\n",
$uuid->toString(),
$record['notes']
);
}
We'll also need to query the database using the bytes.
.. code-block:: php
:caption: Look-up the record from the database, using the UUID bytes
:name: database.uuid-bytes-select-example
use Ramsey\Uuid\Uuid;
$uuid = Uuid::fromString('278198d3-fa96-4833-abab-82f9e67f4712');
$dbh = new PDO($dsn, $username, $password);
$sth = $dbh->prepare('
SELECT uuid, notes
FROM notes
WHERE uuid = :uuid
');
$sth->execute([
':uuid' => $uuid->getBytes(),
]);
$record = $sth->fetch();
if ($record) {
$uuid = Uuid::fromBytes($record['uuid']);
printf(
"UUID: %s\nNotes: %s\n\n",
$uuid->toString(),
$record['notes']
);
}
.. _database.pk:
Using As a Primary Key
######################
In the previous examples, we didn't use the UUID as a primary key, but it's logical to use the ``notes.uuid`` field as a
primary key. There's nothing wrong with this approach, but there are a couple of points to consider:
* InnoDB stores data in the primary key order
* All the secondary keys also contain the primary key (in InnoDB)
We'll deal with the first point in the section, :ref:`database.order`. For the second point, if you are using the string
version of the UUID (i.e., ``char(36)``), then not only will the primary key be large and take up a lot of space, but
every secondary key that uses that primary key will also be much larger.
For this reason, if you choose to use UUIDs as primary keys, it might be worth the drawbacks to use UUID bytes (i.e.,
``char(16)``) instead of the string representation (see :ref:`database.bytes`).
.. hint::
If not using InnoDB with MySQL or MariaDB, consult your database engine documentation to find whether it also has
similar properties that will factor into your use of UUIDs.
.. _database.uk:
Using As a Unique Key
#####################
Instead of :ref:`using UUIDs as a primary key <database.pk>`, you may choose to use an ``AUTO_INCREMENT`` column with
the ``int unsigned`` data type as a primary key, while using a ``char(36)`` for UUIDs and setting a ``UNIQUE KEY`` on
this column. This will aid in lookups while helping keep your secondary keys small.
.. code-block:: sql
:caption: Use an auto-incrementing column as primary key, with UUID as a unique key
:name: database.id-auto-increment-uuid-unique-key
CREATE TABLE `notes` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`uuid` char(36) NOT NULL,
`notes` text NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `notes_uuid_uk` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
.. _database.order:
Insertion Order and Sorting
###########################
UUID versions 1, 2, 3, 4, and 5 are not *monotonically increasing*. If using these versions as primary keys, the inserts
will be random, and the data will be scattered on disk (for InnoDB). Over time, as the database size grows, lookups will
become slower and slower.
.. tip::
See Percona's "`Storing UUID Values in MySQL`_" post, for more details on the performance of UUIDs as primary keys.
To minimize these problems, two solutions have been devised:
1. :ref:`rfc4122.version6` UUIDs
2. :ref:`rfc4122.version7` UUIDs
.. note::
We previously recommended the use of the :ref:`timestamp-first COMB <customize.timestamp-first-comb-codec>` or
:ref:`ordered-time <customize.ordered-time-codec>` codecs to solve these problems. However, UUID versions 6 and 7
were defined to provide these solutions in a standardized way.
.. _ramsey/uuid-doctrine: https://github.com/ramsey/uuid-doctrine
.. _Doctrine field type: https://www.doctrine-project.org/projects/doctrine-dbal/en/stable/reference/types.html
.. _MariaDB: https://mariadb.org
.. _PHP Data Objects (PDO): https://www.php.net/pdo
.. _Storing UUID Values in MySQL: https://www.percona.com/blog/store-uuid-optimized-way/
================================================
FILE: docs/faq.rst
================================================
.. _faq:
=================================
Frequently Asked Questions (FAQs)
=================================
.. contents::
:local:
:depth: 1
.. _faq.rhumsaa-abandoned:
How do I fix "rhumsaa/uuid is abandoned" messages?
##################################################
When installing your project's dependencies using Composer, you might see the following message:
.. code-block:: text
Package rhumsaa/uuid is abandoned; you should avoid using it. Use ramsey/uuid instead.
Don't panic. Simply execute the following commands with Composer:
.. code-block:: bash
composer remove rhumsaa/uuid
composer require ramsey/uuid=^2.9
After doing so, you will have the latest ramsey/uuid package in the 2.x series, and there will be no need to modify any
code; the namespace in the 2.x series is still ``Rhumsaa``.
.. _faq.final:
Why does ramsey/uuid use ``final``?
###################################
You might notice that many of the concrete classes returned in ramsey/uuid are marked as ``final``. There are specific
reasons for this choice, and I will offer a few solutions for those looking to extend or mock the classes for testing
purposes.
But Why?
--------
.. raw:: html
<div style="width:100%;height:0;padding-bottom:56%;position:relative;">
<iframe src="https://giphy.com/embed/eauCbbW6MvqKI" width="100%" height="100%" style="position:absolute" frameBorder="0" class="giphy-embed" allowFullScreen></iframe>
</div>
<p><a href="https://giphy.com/gifs/eauCbbW6MvqKI">via GIPHY</a></p>
First, let's take a look at why ramsey/uuid uses ``final``.
UUIDs are defined by a set of rules --- published as `RFC 9562`_ (formerly `RFC 4122`_) --- and those rules shouldn't
change. If they do, then it's no longer a UUID --- at least not as defined by `RFC 9562`_.
As an example, let's think about :php:class:`Rfc4122\\UuidV1 <Ramsey\\Uuid\\Rfc4122\\UuidV1>`. If our application wants
to do something special with this type, it might use the ``instanceof`` operator to check that a variable is a UuidV1,
or it might use a type hint on a method argument. If a third-party library passes a UUID object to us that extends
UuidV1 but overrides some very important internal logic, then we may no longer have a version 1 UUID. Perhaps we can all
be adults and play nicely, but ramsey/uuid cannot make any guarantees for any subclasses of UuidV1.
However, ramsey/uuid *can* make guarantees about classes that implement :php:interface:`UuidInterface <Ramsey\\Uuid\\UuidInterface>`
or :php:interface:`Rfc4122\\UuidInterface <Ramsey\\Uuid\\Rfc4122\\UuidInterface>`.
So, if we're working with an instance of a class that is marked ``final``, we can guarantee that the rules for the
creation of that object will not change, even if a third-party library passes us an instance of the same class.
This is the reason why ramsey/uuid specifies certain :ref:`argument and return types <reference.types>` that are marked
``final``. Since these are ``final``, ramsey/uuid is able to guarantee the type of data these value objects contain.
:php:class:`Type\\Integer <Ramsey\\Uuid\\Type\\Integer>` should never contain any characters other than numeral digits,
and :php:class:`Type\\Hexadecimal <Ramsey\\Uuid\\Type\\Hexadecimal>` should never contain any characters other than
hexadecimal digits. If other libraries could extend these and return them from UUID instances, then ramsey/uuid cannot
guarantee their values.
This is very similar to using strict types with ``int``, ``float``, or ``bool``. These types cannot change, so think of
final classes in ramsey/uuid as types that cannot change.
Overriding Behavior
-------------------
You may override the behavior of ramsey/uuid as much as you want. Despite the use of ``final``, the library is very
flexible. Take a look at the myriad opportunities to change how the library works:
* :ref:`rfc4122.version1.random`
* :ref:`customize.timestamp-first-comb-codec`
* :ref:`customize.factory`
* :ref:`And more... <customize>`
ramsey/uuid is able to provide this flexibility through the use of `interfaces`_, `factories`_, and `dependency injection`_.
At the same time, ramsey/uuid is able to guarantee that neither a :php:class:`UuidV1 <Ramsey\\Uuid\\Rfc4122\\UuidV1>`
nor a :php:class:`UuidV4 <Ramsey\\Uuid\\Rfc4122\\UuidV4>` nor an :php:class:`Integer <Ramsey\\Uuid\\Type\\Integer>` nor
a :php:class:`Time <Ramsey\\Uuid\\Type\\Time>`, etc. will ever change because of `downstream`_ code.
UUIDs have specific rules that make them practically unique. ramsey/uuid ensures that other code cannot change this
expectation while allowing your code and third-party libraries to change how UUIDs are generated and to return different
types of UUIDs not specified by `RFC 9562`_.
Testing With UUIDs
------------------
Sometimes, the use of ``final`` can throw a wrench in our ability to write tests, but it doesn't have to be that way. To
learn a few techniques for using ramsey/uuid instances in your tests, take a look at :ref:`testing`.
.. _RFC 4122: https://www.rfc-editor.org/rfc/rfc4122
.. _RFC 9562: https://www.rfc-editor.org/rfc/rfc9562
.. _interfaces: https://www.php.net/interfaces
.. _factories: https://en.wikipedia.org/wiki/Factory_%28object-oriented_programming%29
.. _dependency injection: https://en.wikipedia.org/wiki/Dependency_injection
.. _downstream: https://en.wikipedia.org/wiki/Downstream_(software_development)
================================================
FILE: docs/index.rst
================================================
.. _index:
======================
ramsey/uuid User Guide
======================
For `ramsey/uuid <https://github.com/ramsey/uuid>`_ |version|. Updated on |today|.
Contents
--------
.. toctree::
:maxdepth: 2
:includehidden:
introduction
quickstart
rfc4122
nonstandard
database
customize
testing
upgrading
FAQs <faq>
reference
copyright
Indices and Tables
------------------
* :ref:`genindex`
* :ref:`search`
================================================
FILE: docs/introduction.rst
================================================
.. _introduction:
============
Introduction
============
ramsey/uuid is a PHP library for generating and working with `RFC 9562`_ (formerly `RFC 4122`_) version 1, 2, 3, 4, 5,
6, 7, and 8 universally unique identifiers (UUID). ramsey/uuid also supports optional and non-standard features, such as
GUIDs and other approaches for encoding/decoding UUIDs.
What Is a UUID?
###############
A universally unique identifier, or UUID, is a 128-bit unsigned integer, usually represented as a hexadecimal string
split into five groups with dashes. The most widely-known and used types of UUIDs are defined by `RFC 9562`_ (formerly
`RFC 4122`_).
A UUID, when encoded in hexadecimal string format, looks like:
.. code-block:: text
ebb5c735-0308-4e3c-9aea-8a270aebfe15
The probability of duplicating a UUID is close to zero, so they are a great choice for generating unique identifiers in
distributed systems.
UUIDs can also be stored in binary format, as a string of 16 bytes.
.. _RFC 4122: https://www.rfc-editor.org/rfc/rfc4122
.. _RFC 9562: https://www.rfc-editor.org/rfc/rfc9562
================================================
FILE: docs/nonstandard/guid.rst
================================================
.. _nonstandard.guid:
===================================
Globally Unique Identifiers (GUIDs)
===================================
.. tip::
Using these techniques to work with GUIDs is useful if you're working with identifiers that have been stored in GUID
byte order. For example, this is the case if working with the ``UNIQUEIDENTIFIER`` data type in Microsoft SQL Server.
This is a GUID, stored as a 16-byte binary string. If working directly with the bytes, you may use the GUID
functionality in ramsey/uuid to properly handle this data type.
According to the Windows Dev Center article on `GUID structure`_, "GUIDs are the Microsoft implementation of the
distributed computing environment (DCE) universally unique identifier." For all intents and purposes, a GUID string
representation is identical to that of an `RFC 9562`_ (formerly `RFC 4122`_) UUID. For historical reasons, *the byte
order is not*.
The `.NET Framework documentation`_ explains:
Note that the order of bytes in the returned byte array is different from the string representation of a Guid value.
The order of the beginning four-byte group and the next two two-byte groups is reversed, whereas the order of the
last two-byte group and the closing six-byte group is the same.
This is best explained by example.
.. code-block:: php
:caption: Decoding a GUID from byte representation
:name: nonstandard.guid.decode-bytes-example
use Ramsey\Uuid\FeatureSet;
use Ramsey\Uuid\UuidFactory;
// The bytes of a GUID previously stored in some datastore.
$guidBytes = hex2bin('0eab93fc9ec9584b975e9c5e68c53624');
$useGuids = true;
$featureSet = new FeatureSet($useGuids);
$factory = new UuidFactory($featureSet);
$guid = $factory->fromBytes($guidBytes);
printf(
"Class: %s\nGUID: %s\nVersion: %d\nBytes: %s\n",
get_class($guid),
$guid->toString(),
$guid->getFields()->getVersion(),
bin2hex($guid->getBytes())
);
This transforms the bytes of a GUID, as represented by ``$guidBytes``, into a :php:class:`Ramsey\\Uuid\\Guid\\Guid`
instance and prints out some details about it. It looks something like this:
.. code-block:: text
Class: Ramsey\Uuid\Guid\Guid
GUID: fc93ab0e-c99e-4b58-975e-9c5e68c53624
Version: 4
Bytes: 0eab93fc9ec9584b975e9c5e68c53624
Note the difference between the string GUID and the bytes. The bytes are arranged like this:
.. code-block:: text
0e ab 93 fc 9e c9 58 4b 97 5e 9c 5e 68 c5 36 24
In an `RFC 9562`_ (formerly `RFC 4122`_) UUID, the bytes are stored in the same order as you see presented in the string
representation. This is often called *network byte order*, or *big-endian* order. In a GUID, the order of the bytes are
reversed in each grouping for the first 64 bits and stored in *little-endian* order. The remaining 64 bits are stored in
network byte order. See `Endianness <#nonstandard-guid-endianness>`_ to learn more.
.. caution::
The bytes themselves do not indicate their order. If you decode GUID bytes as a UUID or UUID bytes as a GUID, you
will get the wrong values. However, you can always create a GUID or UUID from the same string value; the bytes for
each will be in a different order, even though the string is the same.
The key is to know ahead of time in what order the bytes are stored. Then, you will be able to decode them using the
correct approach.
Converting GUIDs to UUIDs
#########################
Continuing from the example, :ref:`nonstandard.guid.decode-bytes-example`, we can take the GUID string representation
and convert it into a standard UUID.
.. code-block:: php
:caption: Convert a GUID to a UUID
:name: nonstandard.guid.convert-example
$uuid = Uuid::fromString($guid->toString());
printf(
"Class: %s\nUUID: %s\nVersion: %d\nBytes: %s\n",
get_class($uuid),
$uuid->toString(),
$uuid->getFields()->getVersion(),
bin2hex($uuid->getBytes())
);
Because the GUID was a version 4, random UUID, this creates an instance of :php:class:`Ramsey\\Uuid\\Rfc4122\\UuidV4`
from the GUID string and prints out a few details about it. It looks something like this:
.. code-block:: text
Class: Ramsey\Uuid\Rfc4122\UuidV4
UUID: fc93ab0e-c99e-4b58-975e-9c5e68c53624
Version: 4
Bytes: fc93ab0ec99e4b58975e9c5e68c53624
Note how the UUID string is identical to the GUID string. However, the byte order is different, since they are in
big-endian order. The bytes are now arranged like this:
.. code-block:: text
fc 93 ab 0e c9 9e 4b 58 97 5e 9c 5e 68 c5 36 24
.. admonition:: Endianness
:name: nonstandard.guid.endianness
Big-endian and little-endian refer to the ordering of bytes in a multi-byte number. Big-endian order places the most
significant byte first, followed by the other bytes in descending order. Little-endian order places the least
significant byte first, followed by the other bytes in ascending order.
Take the hexadecimal number ``0x1234``, for example. In big-endian order, the bytes are stored as ``12 34``, and in
little-endian order, they are stored as ``34 12``. In either case, the number is still ``0x1234``.
Networking protocols usually use big-endian ordering, while computer processor architectures often use little-endian
ordering.
The terms originated in Jonathan Swift's *Gulliver's Travels*, where the Lilliputians argue over which end of a
hard-boiled egg is the best end to crack.
.. _GUID structure: https://learn.microsoft.com/en-us/windows/win32/api/guiddef/ns-guiddef-guid
.. _RFC 4122: https://www.rfc-editor.org/rfc/rfc4122
.. _RFC 9562: https://www.rfc-editor.org/rfc/rfc9562
.. _.NET Framework documentation: https://learn.microsoft.com/en-us/dotnet/api/system.guid.tobytearray
================================================
FILE: docs/nonstandard/other.rst
================================================
.. _nonstandard.other:
=======================
Other Nonstandard UUIDs
=======================
Sometimes, you might encounter a string that looks like a UUID but doesn't follow the `RFC 9562`_ (formerly `RFC 4122`_)
specification. Take this string, for example:
.. code-block:: text
d95959bc-2ff5-43eb-fccd-14883ba8f174
At a glance, this looks like a valid UUID, but the variant bits don't match `RFC 9562`_ (formerly `RFC 4122`_). Instead
of throwing a validation exception, ramsey/uuid will assume this is a UUID, since it fits the format and has 128 bits,
but it will represent it as a :php:class:`Ramsey\\Uuid\\Nonstandard\\Uuid`.
.. code-block:: php
:caption: Create an instance of :php:class:`Ramsey\\Uuid\\Nonstandard\\Uuid` from a non-RFC 9562 UUID
use Ramsey\Uuid\Uuid;
$uuid = Uuid::fromString('d95959bc-2ff5-43eb-fccd-14883ba8f174');
printf(
"Class: %s\nUUID: %s\nVersion: %d\nVariant: %s\n",
get_class($uuid),
$uuid->toString(),
$uuid->getFields()->getVersion(),
$uuid->getFields()->getVariant()
);
This will create a :php:class:`Ramsey\\Uuid\\Nonstandard\\Uuid` from the given string and print out a few details about
it. It will look something like this:
.. code-block:: text
Class: Ramsey\Uuid\Nonstandard\Uuid
UUID: d95959bc-2ff5-43eb-fccd-14883ba8f174
Version: 0
Variant: 7
Note that the version is 0. Since the variant is 7, and there is no formal specification for this variant of UUID,
ramsey/uuid has no way of knowing what type of UUID this is.
.. _RFC 4122: https://www.rfc-editor.org/rfc/rfc4122
.. _RFC 9562: https://www.rfc-editor.org/rfc/rfc9562
================================================
FILE: docs/nonstandard/version6.rst
================================================
.. _nonstandard.version6:
===================================
Version 6: Reordered Gregorian Time
===================================
.. attention::
This documentation has moved to :ref:`RFC 9562 UUIDs: Version 6: Reordered
Gregorian Time <rfc4122.version6>`.
The :php:class:`Ramsey\\Uuid\\Nonstandard\\UuidV6` class is deprecated in
favor of :php:class:`Ramsey\\Uuid\\Rfc4122\\UuidV6`.
================================================
FILE: docs/nonstandard.rst
================================================
.. _nonstandard:
=================
Nonstandard UUIDs
=================
.. toctree::
:titlesonly:
:hidden:
nonstandard/version6
nonstandard/guid
nonstandard/other
Outside of `RFC 9562`_ (formerly `RFC 4122`_), other types of UUIDs are in-use, following rules of their own. Some of
these are on their way to becoming accepted standards, while others have historical reasons for remaining valid today.
Still, others are completely random and do not follow any rules.
For these cases, ramsey/uuid provides a special functionality to handle these alternate, nonstandard forms.
Globally Unique Identifiers (GUIDs)
A globally unique identifier, or GUID, is often used as a synonym for UUID. A key difference is the order of the
bytes. Any `RFC 9562`_ version UUID may be represented as a GUID. For more details, see :ref:`nonstandard.guid`.
Other Nonstandard UUIDs
Sometimes, UUID string or byte representations don't follow `RFC 9562`_. Rather than reject these identifiers,
ramsey/uuid returns them with the special Nonstandard\\Uuid instance type. For more details, see
:ref:`nonstandard.other`.
.. _RFC 4122: https://www.rfc-editor.org/rfc/rfc4122
.. _RFC 9562: https://www.rfc-editor.org/rfc/rfc9562
================================================
FILE: docs/quickstart.rst
================================================
.. _quickstart:
===============
Getting Started
===============
Requirements
############
ramsey/uuid |version| requires the following:
* PHP 8.0+
* `ext-json <https://www.php.net/manual/en/book.json.php>`_
The JSON extension is normally enabled by default, but it is possible to disable it. Other required extensions include
`PCRE <https://www.php.net/manual/en/book.pcre.php>`_ and `SPL <https://www.php.net/manual/en/book.spl.php>`_. These
standard extensions cannot be disabled without patching PHP's build system and/or C sources.
ramsey/uuid recommends installing/enabling the following extensions. While not required, these extensions improve the
performance of ramsey/uuid.
* `ext-gmp <https://www.php.net/manual/en/book.gmp.php>`_
* `ext-bcmath <https://www.php.net/manual/en/book.bc.php>`_
Install With Composer
#####################
The only supported installation method for ramsey/uuid is `Composer <https://getcomposer.org>`_. Use the following
command to add ramsey/uuid to your project dependencies:
.. code-block:: bash
composer require ramsey/uuid
Using ramsey/uuid
#################
After installing ramsey/uuid, the quickest way to get up-and-running is to use the static generation methods.
.. code-block:: php
use Ramsey\Uuid\Uuid;
$uuid = Uuid::uuid4();
printf(
"UUID: %s\nVersion: %d\n",
$uuid->toString(),
$uuid->getFields()->getVersion()
);
This will return an instance of :php:class:`Ramsey\\Uuid\\Rfc4122\\UuidV4`.
.. tip::
.. rubric:: Use the Interfaces
Feel free to use ``instanceof`` to check the specific instance types of UUIDs. However, when using type hints, it's
best to use the interfaces.
The most lenient interface is :php:interface:`Ramsey\\Uuid\\UuidInterface`, while
:php:interface:`Ramsey\\Uuid\\Rfc4122\\UuidInterface` ensures the UUIDs you're using conform to the `RFC 9562`_
(formerly `RFC 4122`_) standard. If you're not sure which one to use, start with the stricter
:php:interface:`Rfc4122\\UuidInterface <Ramsey\\Uuid\\Rfc4122\\UuidInterface>`.
ramsey/uuid provides a number of helpful static methods that help you work with and generate most types of UUIDs,
without any special customization of the library.
.. list-table::
:widths: 25 75
:align: center
:header-rows: 1
* - Method
- Description
* - :php:meth:`Uuid::uuid1() <Ramsey\\Uuid\\Uuid::uuid1>`
- This generates a :ref:`rfc4122.version1` UUID.
* - :php:meth:`Uuid::uuid2() <Ramsey\\Uuid\\Uuid::uuid2>`
- This generates a :ref:`rfc4122.version2` UUID.
* - :php:meth:`Uuid::uuid3() <Ramsey\\Uuid\\Uuid::uuid3>`
- This generates a :ref:`rfc4122.version3` UUID.
* - :php:meth:`Uuid::uuid4() <Ramsey\\Uuid\\Uuid::uuid4>`
- This generates a :ref:`rfc4122.version4` UUID.
* - :php:meth:`Uuid::uuid5() <Ramsey\\Uuid\\Uuid::uuid5>`
- This generates a :ref:`rfc4122.version5` UUID.
* - :php:meth:`Uuid::uuid6() <Ramsey\\Uuid\\Uuid::uuid6>`
- This generates a :ref:`rfc4122.version6` UUID.
* - :php:meth:`Uuid::uuid7() <Ramsey\\Uuid\\Uuid::uuid7>`
- This generates a :ref:`rfc4122.version7` UUID.
* - :php:meth:`Uuid::uuid8() <Ramsey\\Uuid\\Uuid::uuid8>`
- This generates a :ref:`rfc4122.version8` UUID.
* - :php:meth:`Uuid::isValid() <Ramsey\\Uuid\\Uuid::isValid>`
- Checks whether a string is a valid UUID.
* - :php:meth:`Uuid::fromString() <Ramsey\\Uuid\\Uuid::fromString>`
- Creates a UUID instance from a string UUID.
* - :php:meth:`Uuid::fromBytes() <Ramsey\\Uuid\\Uuid::fromBytes>`
- Creates a UUID instance from a 16-byte string.
* - :php:meth:`Uuid::fromInteger() <Ramsey\\Uuid\\Uuid::fromInteger>`
- Creates a UUID instance from a string integer.
* - :php:meth:`Uuid::fromDateTime() <Ramsey\\Uuid\\Uuid::fromDateTime>`
- Creates a version 1 UUID instance from a PHP `DateTimeInterface`_.
.. _RFC 4122: https://www.rfc-editor.org/rfc/rfc4122
.. _RFC 9562: https://www.rfc-editor.org/rfc/rfc9562
.. _DateTimeInterface: https://www.php.net/datetimeinterface
================================================
FILE: docs/reference/calculators.rst
================================================
.. _reference.calculators:
===========
Calculators
===========
.. php:namespace:: Ramsey\Uuid\Math
.. php:interface:: CalculatorInterface
Provides functionality for performing mathematical calculations.
.. php:method:: add($augend, ...$addends)
:param Ramsey\\Uuid\\Type\\NumberInterface $augend: The first addend (the integer being added to)
:param Ramsey\\Uuid\\Type\\NumberInterface ...$addends: The additional integers to a add to the augend
:returns: The sum of all the parameters
:returntype: Ramsey\\Uuid\\Type\\NumberInterface
.. php:method:: subtract($minuend, ...$subtrahends)
:param Ramsey\\Uuid\\Type\\NumberInterface $minuend: The integer being subtracted from
:param Ramsey\\Uuid\\Type\\NumberInterface ...$subtrahends: The integers to subtract from the minuend
:returns: The difference after subtracting all parameters
:returntype: Ramsey\\Uuid\\Type\\NumberInterface
.. php:method:: multiply($multiplicand, ...$multipliers)
:param Ramsey\\Uuid\\Type\\NumberInterface $multiplicand: The integer to be multiplied
:param Ramsey\\Uuid\\Type\\NumberInterface ...$multipliers: The factors by which to multiply the multiplicand
:returns: The product of multiplying all the provided parameters
:returntype: Ramsey\\Uuid\\Type\\NumberInterface
.. php:method:: divide($roundingMode, $scale, $dividend, ...$divisors)
:param int $roundingMode: The strategy for rounding the quotient; one of the :php:class:`Ramsey\\Uuid\\Math\\RoundingMode` constants
:param int $scale: The scale to use for the operation
:param Ramsey\\Uuid\\Type\\NumberInterface $dividend: The integer to be divided
:param Ramsey\\Uuid\\Type\\NumberInterface ...$divisors: The integers to divide ``$dividend`` by, in the order in which the division operations should take place (left-to-right)
:returns: The quotient of dividing the provided parameters left-to-right
:returntype: Ramsey\\Uuid\\Type\\NumberInterface
.. php:method:: fromBase($value, $base)
Converts a value from an arbitrary base to a base-10 integer value.
:param string $value: The value to convert
:param int $base: The base to convert from (i.e., 2, 16, 32, etc.)
:returns: The base-10 integer value of the converted value
:returntype: Ramsey\\Uuid\\Type\\Integer
.. php:method:: toBase($value, $base)
Converts a base-10 integer value to an arbitrary base.
:param Ramsey\\Uuid\\Type\\Integer $value: The integer value to convert
:param int $base: The base to convert to (i.e., 2, 16, 32, etc.)
:returns: The value represented in the specified base
:returntype: ``string``
.. php:method:: toHexadecimal($value)
Converts an Integer instance to a Hexadecimal instance.
:param Ramsey\\Uuid\\Type\\Integer $value: The Integer to convert to Hexadecimal
:returntype: Ramsey\\Uuid\\Type\\Hexadecimal
.. php:method:: toInteger($value)
Converts a Hexadecimal instance to an Integer instance.
:param Ramsey\\Uuid\\Type\\Hexadecimal $value: The Hexadecimal to convert to Integer
:returntype: Ramsey\\Uuid\\Type\\Integer
.. php:class:: RoundingMode
.. php:const:: UNNECESSARY
Asserts that the requested operation has an exact result, hence no rounding is necessary.
.. php:const:: UP
Rounds away from zero.
Always increments the digit prior to a nonzero discarded fraction. Note that this rounding mode never decreases
the magnitude of the calculated value.
.. php:const:: DOWN
Rounds towards zero.
Never increments the digit prior to a discarded fraction (i.e., truncates). Note that this rounding mode never
increases the magnitude of the calculated value.
.. php:const:: CEILING
Rounds towards positive infinity.
If the result is positive, behaves as for :php:const:`UP <Ramsey\\Uuid\\Math\\RoundingMode::UP>`; if negative,
behaves as for :php:const:`DOWN <Ramsey\\Uuid\\Math\\RoundingMode::DOWN>`. Note that this rounding mode never
decreases the calculated value.
.. php:const:: FLOOR
Rounds towards negative infinity.
If the result is positive, behave as for :php:const:`DOWN <Ramsey\\Uuid\\Math\\RoundingMode::DOWN>`; if negative,
behave as for :php:const:`UP <Ramsey\\Uuid\\Math\\RoundingMode::UP>`. Note that this rounding mode never
increases the calculated value.
.. php:const:: HALF_UP
Rounds towards "nearest neighbor" unless both neighbors are equidistant, in which case round up.
Behaves as for :php:const:`UP <Ramsey\\Uuid\\Math\\RoundingMode::UP>` if the discarded fraction is >= 0.5;
otherwise, behaves as for :php:const:`DOWN <Ramsey\\Uuid\\Math\\RoundingMode::DOWN>`. Note that this is the
rounding mode commonly taught at school.
.. php:const:: HALF_DOWN
Rounds towards "nearest neighbor" unless both neighbors are equidistant, in which case round down.
Behaves as for :php:const:`UP <Ramsey\\Uuid\\Math\\RoundingMode::UP>` if the discarded fraction is > 0.5;
otherwise, behaves as for :php:const:`DOWN <Ramsey\\Uuid\\Math\\RoundingMode::DOWN>`.
.. php:const:: HALF_CEILING
Rounds towards "nearest neighbor" unless both neighbors are equidistant, in which case round towards positive
infinity.
If the result is positive, behaves as for :php:const:`HALF_UP <Ramsey\\Uuid\\Math\\RoundingMode::HALF_UP>`; if
negative, behaves as for :php:const:`HALF_DOWN <Ramsey\\Uuid\\Math\\RoundingMode::HALF_DOWN>`.
.. php:const:: HALF_FLOOR
Rounds towards "nearest neighbor" unless both neighbors are equidistant, in which case round towards negative
infinity.
If the result is positive, behaves as for :php:const:`HALF_DOWN <Ramsey\\Uuid\\Math\\RoundingMode::HALF_DOWN>`;
if negative, behaves as for :php:const:`HALF_UP <Ramsey\\Uuid\\Math\\RoundingMode::HALF_UP>`.
.. php:const:: HALF_EVEN
Rounds towards the "nearest neighbor" unless both neighbors are equidistant, in which case rounds towards the
even neighbor.
Behaves as for :php:const:`HALF_UP <Ramsey\\Uuid\\Math\\RoundingMode::HALF_UP>` if the digit to the left of the
discarded fraction is odd; behaves as for :php:const:`HALF_DOWN <Ramsey\\Uuid\\Math\\RoundingMode::HALF_DOWN>`
if it's even.
Note that this is the rounding mode that statistically minimizes cumulative error when applied repeatedly over a
sequence of calculations. It is sometimes known as "Banker's rounding", and is chiefly used in the USA.
================================================
FILE: docs/reference/exceptions.rst
================================================
.. _reference.exceptions:
==========
Exceptions
==========
All exceptions in the :php:ns:`Ramsey\\Uuid` namespace implement :php:interface:`Ramsey\\Uuid\\Exception\\UuidExceptionInterface`.
This provides a base type you may use to catch any and all exceptions that originate from this library.
.. php:namespace:: Ramsey\Uuid\Exception
.. php:interface:: UuidExceptionInterface
This is the interface all exceptions in ramsey/uuid must implement.
.. php:exception:: BuilderNotFoundException
Extends `RuntimeException <https://www.php.net/runtimeexception>`_.
Thrown to indicate that no suitable UUID builder could be found.
.. php:exception:: DateTimeException
Extends `RuntimeException <https://www.php.net/runtimeexception>`_.
Thrown to indicate that the PHP DateTime extension encountered an exception or error.
.. php:exception:: DceSecurityException
Extends `RuntimeException <https://www.php.net/runtimeexception>`_.
Thrown to indicate an exception occurred while dealing with DCE Security (version 2) UUIDs
.. php:exception:: InvalidArgumentException
Extends `InvalidArgumentException <https://www.php.net/invalidargumentexception>`_.
Thrown to indicate that the argument received is not valid.
.. php:exception:: InvalidBytesException
Extends `RuntimeException <https://www.php.net/runtimeexception>`_.
Thrown to indicate that the bytes being operated on are invalid in some way.
.. php:exception:: InvalidUuidStringException
Extends :php:exc:`Ramsey\\Uuid\\Exception\\InvalidArgumentException`.
Thrown to indicate that the string received is not a valid UUID.
.. php:exception:: NameException
Extends `RuntimeException <https://www.php.net/runtimeexception>`_.
Thrown to indicate that an error occurred while attempting to hash a namespace and name
.. php:exception:: NodeException
Extends `RuntimeException <https://www.php.net/runtimeexception>`_.
Thrown to indicate that attempting to fetch or create a node ID encountered an error.
.. php:exception:: RandomSourceException
Extends `RuntimeException <https://www.php.net/runtimeexception>`_.
Thrown to indicate that the source of random data encountered an error.
.. php:exception:: TimeSourceException
Extends `RuntimeException <https://www.php.net/runtimeexception>`_.
Thrown to indicate that the source of time encountered an error.
.. php:exception:: UnableToBuildUuidException
Extends `RuntimeException <https://www.php.net/runtimeexception>`_.
Thrown to indicate a builder is unable to build a UUID.
.. php:exception:: UnsupportedOperationException
Extends `LogicException <https://www.php.net/logicexception>`_.
Thrown to indicate that the requested operation is not supported.
================================================
FILE: docs/reference/fields-fieldsinterface.rst
================================================
.. _reference.fields.fieldsinterface:
========================
Fields\\FieldsInterface
========================
.. php:namespace:: Ramsey\Uuid\Fields
.. php:interface:: FieldsInterface
Represents the fields of a UUID.
.. php:method:: getBytes()
:returns: The bytes that comprise these fields.
:returntype: ``string``
================================================
FILE: docs/reference/guid-fields.rst
================================================
.. _reference.guid.fields:
============
Guid\\Fields
============
.. php:namespace:: Ramsey\Uuid\Guid
.. php:class:: Fields
Implements :php:interface:`Ramsey\\Uuid\\Rfc4122\\FieldsInterface`.
Guid\Fields represents the fields of a GUID.
================================================
FILE: docs/reference/guid-guid.rst
================================================
.. _reference.guid.guid:
==========
Guid\\Guid
==========
.. php:namespace:: Ramsey\Uuid\Guid
.. php:class:: Guid
Implements :php:interface:`Ramsey\\Uuid\\UuidInterface`.
Guid represents a :ref:`nonstandard.guid`. In addition to providing the methods defined on the interface, this class
additionally provides the following methods.
.. php:method:: getFields()
:returns: The fields that comprise this GUID.
:returntype: Ramsey\\Uuid\\Guid\\Fields
================================================
FILE: docs/reference/helper.rst
================================================
.. _reference.helper:
================
Helper Functions
================
ramsey/uuid additionally provides the following helper functions, which return only the string standard representation
of a UUID.
.. php:function:: Ramsey\Uuid\v1([$node[, $clockSeq]])
Generates a string standard representation of a version 1, Gregorian time UUID.
:param Ramsey\\Uuid\\Type\\Hexadecimal|null $node: An optional hexadecimal node to use
:param int|null $clockSeq: An optional clock sequence to use
:returns: A string standard representation of a version 1 UUID
:returntype: string
.. php:function:: Ramsey\Uuid\v2($localDomain[, $localIdentifier[, $node[, $clockSeq]]])
Generates a string standard representation of a version 2, DCE Security UUID.
:param int $localDomain: The local domain to use (one of ``Uuid::DCE_DOMAIN_PERSON``, ``Uuid::DCE_DOMAIN_GROUP``, or ``Uuid::DCE_DOMAIN_ORG``)
:param Ramsey\\Uuid\\Type\\Integer|null $localIdentifier: A local identifier for the domain (defaults to system UID or GID for *person* or *group*)
:param Ramsey\\Uuid\\Type\\Hexadecimal|null $node: An optional hexadecimal node to use
:param int|null $clockSeq: An optional clock sequence to use
:returns: A string standard representation of a version 2 UUID
:returntype: string
.. php:function:: Ramsey\Uuid\v3($ns, $name)
Generates a string standard representation of a version 3, name-based (MD5) UUID.
:param Ramsey\\Uuid\\UuidInterface|string $ns: The namespace for this identifier
:param string $name: The name from which to generate an identifier
:returns: A string standard representation of a version 3 UUID
:returntype: string
.. php:function:: Ramsey\Uuid\v4()
Generates a string standard representation of a version 4, random UUID.
:returns: A string standard representation of a version 4 UUID
:returntype: string
.. php:function:: Ramsey\Uuid\v5($ns, $name)
Generates a string standard representation of a version 5, name-based (SHA-1) UUID.
:param Ramsey\\Uuid\\UuidInterface|string $ns: The namespace for this identifier
:param string $name: The name from which to generate an identifier
:returns: A string standard representation of a version 5 UUID
:returntype: string
.. php:function:: Ramsey\Uuid\v6([$node[, $clockSeq]])
Generates a string standard representation of a version 6, reordered Gregorian time UUID.
:param Ramsey\\Uuid\\Type\\Hexadecimal|null $node: An optional hexadecimal node to use
:param int|null $clockSeq: An optional clock sequence to use
:returns: A string standard representation of a version 6 UUID
:returntype: string
.. php:function:: Ramsey\Uuid\v7([$dateTime])
Generates a string standard representation of a version 7, Unix Epoch time UUID.
:param \\DatetimeInterface|null $node: An optional date/time from which to create the version 7 UUID. If not
provided, the UUID is generated using the current date/time
:returns: A string standard representation of a version 7 UUID
:returntype: string
.. php:function:: Ramsey\Uuid\v8($bytes)
Generates a string standard representation of a version 8, implementation-specific, custom format UUID.
:param string $bytes: A 16-byte octet string. This is an open blob of data that you may fill with 128 bits of
information. Be aware, however, bits 48 through 51 will be replaced with the UUID version
field, and bits 64 and 65 will be replaced with the UUID variant. You MUST NOT rely on
these bits for your application needs.
:returns: A string standard representation of a version 8 UUID
:returntype: string
================================================
FILE: docs/reference/name-based-namespaces.rst
================================================
.. _reference.name-based-namespaces:
=====================
Predefined Namespaces
=====================
`RFC 9562`_ (formerly `RFC 4122`_) defines a handful of UUIDs to use with "for some potentially interesting name spaces."
.. list-table::
:widths: 30 70
:align: center
:header-rows: 1
* - Constant
- Description
* - :php:const:`Uuid::NAMESPACE_DNS <Ramsey\\Uuid\\Uuid::NAMESPACE_DNS>`
- The name string is a fully-qualified domain name.
* - :php:const:`Uuid::NAMESPACE_URL <Ramsey\\Uuid\\Uuid::NAMESPACE_URL>`
- The name string is a URL.
* - :php:const:`Uuid::NAMESPACE_OID <Ramsey\\Uuid\\Uuid::NAMESPACE_OID>`
- The name string is an `ISO object identifier (OID)`_.
* - :php:const:`Uuid::NAMESPACE_X500 <Ramsey\\Uuid\\Uuid::NAMESPACE_X500>`
- The name string is an `X.500`_ `DN`_ in `DER`_ or a text output format.
.. _RFC 4122: https://tools.ietf.org/html/rfc4122
.. _RFC 9562: https://www.rfc-editor.org/rfc/rfc9562
.. _ISO object identifier (OID): http://www.oid-info.com
.. _X.500: https://en.wikipedia.org/wiki/X.500
.. _DN: https://en.wikipedia.org/wiki/Distinguished_Name
.. _DER: https://www.itu.int/rec/T-REC-X.690/
================================================
FILE: docs/reference/nonstandard-fields.rst
================================================
.. _reference.nonstandard.fields:
===================
Nonstandard\\Fields
===================
.. php:namespace:: Ramsey\Uuid\Nonstandard
.. php:class:: Fields
Implements :php:interface:`Ramsey\\Uuid\\Rfc4122\\FieldsInterface`.
Nonstandard\\Fields represents the fields of a nonstandard UUID.
================================================
FILE: docs/reference/nonstandard-uuid.rst
================================================
.. _reference.nonstandard.uuid:
=================
Nonstandard\\Uuid
=================
.. php:namespace:: Ramsey\Uuid\Nonstandard
.. php:class:: Uuid
Implements :php:interface:`Ramsey\\Uuid\\UuidInterface`.
Nonstandard\\Uuid represents :ref:`nonstandard.other`. In addition to providing the methods defined on the interface,
this class additionally provides the following methods.
.. php:method:: getFields()
:returns: The fields that comprise this UUID
:returntype: Ramsey\\Uuid\\Nonstandard\\Fields
================================================
FILE: docs/reference/nonstandard-uuidv6.rst
================================================
.. _reference.nonstandard.uuidv6:
===================
Nonstandard\\UuidV6
===================
.. php:namespace:: Ramsey\Uuid\Nonstandard
.. php:class:: UuidV6
.. attention::
:php:class:`Ramsey\\Uuid\\Nonstandard\\UuidV6` is deprecated in favor of :php:class:`Ramsey\\Uuid\\Rfc4122\\UuidV6`.
Please migrate any code using ``Nonstandard\UuidV6`` to ``Rfc4122\UuidV6``.
Implements :php:interface:`Ramsey\\Uuid\\Rfc4122\\UuidInterface`.
UuidV6 represents a :ref:`version 6, reordered Gregorian time UUID <nonstandard.version6>`. In addition to providing
the methods defined on the interface, this class additionally provides the following methods.
.. php:method:: getDateTime()
:returns: A date object representing the timestamp associated with the UUID
:returntype: ``\DateTimeInterface``
.. php:method:: toUuidV1()
:returns: A version 1 UUID, converted from this version 6 UUID
:returntype: Ramsey\\Uuid\\Rfc4122\\UuidV1
.. php:staticmethod:: fromUuidV1()
:param Ramsey\\Uuid\\Rfc4122\\UuidV1 $uuidV1: A version 1 UUID
:returns: A version 6 UUID, converted from the given version 1 UUID
:returntype: Ramsey\\Uuid\\Rfc4122\\UuidV6
================================================
FILE: docs/reference/rfc4122-fieldsinterface.rst
================================================
.. _reference.rfc4122.fieldsinterface:
========================
Rfc4122\\FieldsInterface
========================
.. php:namespace:: Ramsey\Uuid\Rfc4122
.. php:interface:: FieldsInterface
Implements :php:interface:`Ramsey\\Uuid\\Fields\\FieldsInterface`.
Rfc4122\\FieldsInterface represents the fields of an `RFC 9562`_ (formerly `RFC 4122`_) UUID. In addition to the
methods defined on the interface, this class additionally defines the following methods.
.. php:method:: getClockSeq()
:returns: The full 16-bit clock sequence, with the variant bits (two most significant bits) masked out.
:returntype: Ramsey\\Uuid\\Type\\Hexadecimal
.. php:method:: getClockSeqHiAndReserved()
:returns: The high field of the clock sequence multiplexed with the variant.
:returntype: Ramsey\\Uuid\\Type\\Hexadecimal
.. php:method:: getClockSeqLow()
:returns: The low field of the clock sequence.
:returntype: Ramsey\\Uuid\\Type\\Hexadecimal
.. php:method:: getNode()
:returns: The node field.
:returntype: Ramsey\\Uuid\\Type\\Hexadecimal
.. php:method:: getTimeHiAndVersion()
:returns: The high field of the timestamp multiplexed with the version.
:returntype: Ramsey\\Uuid\\Type\\Hexadecimal
.. php:method:: getTimeLow()
:returns: The low field of the timestamp.
:returntype: Ramsey\\Uuid\\Type\\Hexadecimal
.. php:method:: getTimeMid()
:returns: The middle field of the timestamp.
:returntype: Ramsey\\Uuid\\Type\\Hexadecimal
.. php:method:: getTimestamp()
:returns: The full 60-bit timestamp, without the version.
:returntype: Ramsey\\Uuid\\Type\\Hexadecimal
.. php:method:: getVariant()
Returns the variant, which, for `RFC 9562`_ (formerly `RFC 4122`_) variant UUIDs, should always be the value ``2``.
:returns: The UUID variant.
:returntype: ``int``
.. php:method:: getVersion()
:returns: The UUID version.
:returntype: ``int``
.. php:method:: isNil()
A *nil* UUID is a special type of UUID with all 128 bits set to zero. Its string standard representation is
always ``00000000-0000-0000-0000-000000000000``.
:returns: True if this UUID represents a nil UUID.
:returntype: ``bool``
.. _RFC 4122: https://www.rfc-editor.org/rfc/rfc4122
.. _RFC 9562: https://www.rfc-editor.org/rfc/rfc9562
================================================
FILE: docs/reference/rfc4122-uuidinterface.rst
================================================
.. _reference.rfc4122.uuidinterface:
======================
Rfc4122\\UuidInterface
======================
.. php:namespace:: Ramsey\Uuid\Rfc4122
.. php:interface:: UuidInterface
Implements :php:interface:`Ramsey\\Uuid\\UuidInterface`.
Rfc4122\\UuidInterface represents an `RFC 9562`_ (formerly `RFC 4122`_) UUID. In addition to the methods defined on
the interface, this interface additionally defines the following methods.
.. php:method:: getFields()
:returns: The fields that comprise this UUID.
:returntype: Ramsey\\Uuid\\Rfc4122\\FieldsInterface
.. _RFC 4122: https://www.rfc-editor.org/rfc/rfc4122
.. _RFC 9562: https://www.rfc-editor.org/rfc/rfc9562
================================================
FILE: docs/reference/rfc4122-uuidv1.rst
================================================
.. _reference.rfc4122.uuidv1:
===============
Rfc4122\\UuidV1
===============
.. php:namespace:: Ramsey\Uuid\Rfc4122
.. php:class:: UuidV1
Implements :php:interface:`Ramsey\\Uuid\\Rfc4122\\UuidInterface`.
UuidV1 represents a :ref:`version 1, Gregorian time UUID <rfc4122.version1>`. In addition to providing the methods
defined on the interface, this class additionally provides the following methods.
.. php:method:: getDateTime()
:returns: A date object representing the timestamp associated with the UUID.
:returntype: ``\DateTimeInterface``
================================================
FILE: docs/reference/rfc4122-uuidv2.rst
================================================
.. _reference.rfc4122.uuidv2:
===============
Rfc4122\\UuidV2
===============
.. php:namespace:: Ramsey\Uuid\Rfc4122
.. php:class:: UuidV2
Implements :php:interface:`Ramsey\\Uuid\\Rfc4122\\UuidInterface`.
UuidV2 represents a :ref:`version 2, DCE Security UUID <rfc4122.version2>`. In addition to providing the methods
defined on the interface, this class additionally provides the following methods.
.. php:method:: getDateTime()
Returns a `DateTimeInterface <https://www.php.net/datetimeinterface>`_ instance representing the timestamp
associated with the UUID
.. caution::
It is important to note that version 2 UUIDs suffer from some loss of timestamp precision. See
:ref:`rfc4122.version2.timestamp-problems` to learn more.
:returns: A date object representing the timestamp associated with the UUID
:returntype: ``\DateTimeInterface``
.. php:method:: getLocalDomain()
:returns: The local domain identifier for this UUID, which is one of :php:const:`Ramsey\\Uuid\\Uuid::DCE_DOMAIN_PERSON`,
:php:const:`Ramsey\\Uuid\\Uuid::DCE_DOMAIN_GROUP`, or :php:const:`Ramsey\\Uuid\\Uuid::DCE_DOMAIN_ORG`
:returntype: ``int``
.. php:method:: getLocalDomainName()
:returns: A string name associated with the local domain identifier (one of "person," "group," or "org")
:returntype: ``string``
.. php:method:: getLocalIdentifier()
:returns: The local identifier used when creating this UUID
:returntype: Ramsey\\Uuid\\Type\\Integer
================================================
FILE: docs/reference/rfc4122-uuidv3.rst
================================================
.. _reference.rfc4122.uuidv3:
===============
Rfc4122\\UuidV3
===============
.. php:namespace:: Ramsey\Uuid\Rfc4122
.. php:class:: UuidV3
Implements :php:interface:`Ramsey\\Uuid\\Rfc4122\\UuidInterface`.
UuidV3 represents a :ref:`version 3, name-based (MD5 hashed) UUID <rfc4122.version3>`.
================================================
FILE: docs/reference/rfc4122-uuidv4.rst
================================================
.. _reference.rfc4122.uuidv4:
===============
Rfc4122\\UuidV4
===============
.. php:namespace:: Ramsey\Uuid\Rfc4122
.. php:class:: UuidV4
Implements :php:interface:`Ramsey\\Uuid\\Rfc4122\\UuidInterface`.
UuidV4 represents a :ref:`version 4, random UUID <rfc4122.version4>`.
================================================
FILE: docs/reference/rfc4122-uuidv5.rst
================================================
.. _reference.rfc4122.uuidv5:
===============
Rfc4122\\UuidV5
===============
.. php:namespace:: Ramsey\Uuid\Rfc4122
.. php:class:: UuidV5
Implements :php:interface:`Ramsey\\Uuid\\Rfc4122\\UuidInterface`.
UuidV5 represents a :ref:`version 5, name-based (SHA-1 hashed) UUID <rfc4122.version5>`.
================================================
FILE: docs/reference/rfc4122-uuidv6.rst
================================================
.. _reference.rfc4122.uuidv6:
===============
Rfc4122\\UuidV6
===============
.. php:namespace:: Ramsey\Uuid\Rfc4122
.. php:class:: UuidV6
Implements :php:interface:`Ramsey\\Uuid\\Rfc4122\\UuidInterface`.
UuidV6 represents a :ref:`version 6, reordered Gregorian time UUID <rfc4122.version6>`. In addition to providing the
methods defined on the interface, this class additionally provides the following methods.
.. php:method:: getDateTime()
:returns: A date object representing the timestamp associated with the UUID
:returntype: ``\DateTimeInterface``
.. php:method:: toUuidV1()
:returns: A version 1 UUID, converted from this version 6 UUID
:returntype: Ramsey\\Uuid\\Rfc4122\\UuidV1
.. php:staticmethod:: fromUuidV1()
:param Ramsey\\Uuid\\Rfc4122\\UuidV1 $uuidV1: A version 1 UUID
:returns: A version 6 UUID, converted from the given version 1 UUID
:returntype: Ramsey\\Uuid\\Rfc4122\\UuidV6
================================================
FILE: docs/reference/rfc4122-uuidv7.rst
================================================
.. _reference.rfc4122.uuidv7:
===============
Rfc4122\\UuidV7
===============
.. php:namespace:: Ramsey\Uuid\Rfc4122
.. php:class:: UuidV7
Implements :php:interface:`Ramsey\\Uuid\\Rfc4122\\UuidInterface`.
UuidV7 represents a :ref:`version 7, Unix Epoch time UUID <rfc4122.version7>`. In addition to providing the methods
defined on the interface, this class additionally provides the following methods.
.. php:method:: getDateTime()
:returns: A date object representing the timestamp associated with the UUID.
:returntype: ``\DateTimeInterface``
================================================
FILE: docs/reference/rfc4122-uuidv8.rst
================================================
.. _reference.rfc4122.uuidv8:
===============
Rfc4122\\UuidV8
===============
.. php:namespace:: Ramsey\Uuid\Rfc4122
.. php:class:: UuidV8
Implements :php:interface:`Ramsey\\Uuid\\Rfc4122\\UuidInterface`.
UuidV8 represents a :ref:`version 8, implementation-specific, custom format UUID <rfc4122.version8>`.
================================================
FILE: doc
gitextract_l3omq1zh/
├── .editorconfig
├── .gitattributes
├── .github/
│ ├── CODEOWNERS
│ ├── ISSUE_TEMPLATE/
│ │ ├── Bug_Report.md
│ │ ├── Feature_Request.md
│ │ ├── Question.md
│ │ └── config.yml
│ ├── dependabot.yml
│ ├── pull_request_template.md
│ └── workflows/
│ ├── continuous-integration.yml
│ └── merge-me.yml
├── .gitignore
├── .readthedocs.yml
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── SECURITY.md
├── build/
│ ├── .gitignore
│ ├── cache/
│ │ └── .gitkeep
│ └── logs/
│ └── .gitkeep
├── captainhook.json
├── codecov.yml
├── composer.json
├── docs/
│ ├── .gitignore
│ ├── LICENSE
│ ├── Makefile
│ ├── README.md
│ ├── _static/
│ │ └── .gitkeep
│ ├── conf.py
│ ├── copyright.rst
│ ├── customize/
│ │ ├── calculators.rst
│ │ ├── factory.rst
│ │ ├── ordered-time-codec.rst
│ │ ├── timestamp-first-comb-codec.rst
│ │ └── validators.rst
│ ├── customize.rst
│ ├── database.rst
│ ├── faq.rst
│ ├── index.rst
│ ├── introduction.rst
│ ├── nonstandard/
│ │ ├── guid.rst
│ │ ├── other.rst
│ │ └── version6.rst
│ ├── nonstandard.rst
│ ├── quickstart.rst
│ ├── reference/
│ │ ├── calculators.rst
│ │ ├── exceptions.rst
│ │ ├── fields-fieldsinterface.rst
│ │ ├── guid-fields.rst
│ │ ├── guid-guid.rst
│ │ ├── helper.rst
│ │ ├── name-based-namespaces.rst
│ │ ├── nonstandard-fields.rst
│ │ ├── nonstandard-uuid.rst
│ │ ├── nonstandard-uuidv6.rst
│ │ ├── rfc4122-fieldsinterface.rst
│ │ ├── rfc4122-uuidinterface.rst
│ │ ├── rfc4122-uuidv1.rst
│ │ ├── rfc4122-uuidv2.rst
│ │ ├── rfc4122-uuidv3.rst
│ │ ├── rfc4122-uuidv4.rst
│ │ ├── rfc4122-uuidv5.rst
│ │ ├── rfc4122-uuidv6.rst
│ │ ├── rfc4122-uuidv7.rst
│ │ ├── rfc4122-uuidv8.rst
│ │ ├── types.rst
│ │ ├── uuid.rst
│ │ ├── uuidfactoryinterface.rst
│ │ ├── uuidinterface.rst
│ │ └── validators.rst
│ ├── reference.rst
│ ├── requirements.txt
│ ├── rfc4122/
│ │ ├── version1.rst
│ │ ├── version2.rst
│ │ ├── version3.rst
│ │ ├── version4.rst
│ │ ├── version5.rst
│ │ ├── version6.rst
│ │ ├── version7.rst
│ │ └── version8.rst
│ ├── rfc4122.rst
│ ├── testing.rst
│ ├── upgrading/
│ │ ├── 2-to-3.rst
│ │ └── 3-to-4.rst
│ └── upgrading.rst
├── phpbench.json
├── phpcs.xml.dist
├── phpstan.neon.dist
├── phpunit.xml.dist
├── resources/
│ └── vagrant/
│ ├── .gitignore
│ ├── README.md
│ ├── freebsd/
│ │ ├── README.md
│ │ └── Vagrantfile
│ ├── linux/
│ │ ├── README.md
│ │ └── Vagrantfile
│ └── windows/
│ ├── README.md
│ └── Vagrantfile
├── src/
│ ├── BinaryUtils.php
│ ├── Builder/
│ │ ├── BuilderCollection.php
│ │ ├── DefaultUuidBuilder.php
│ │ ├── DegradedUuidBuilder.php
│ │ ├── FallbackBuilder.php
│ │ └── UuidBuilderInterface.php
│ ├── Codec/
│ │ ├── CodecInterface.php
│ │ ├── GuidStringCodec.php
│ │ ├── OrderedTimeCodec.php
│ │ ├── StringCodec.php
│ │ ├── TimestampFirstCombCodec.php
│ │ └── TimestampLastCombCodec.php
│ ├── Converter/
│ │ ├── Number/
│ │ │ ├── BigNumberConverter.php
│ │ │ ├── DegradedNumberConverter.php
│ │ │ └── GenericNumberConverter.php
│ │ ├── NumberConverterInterface.php
│ │ ├── Time/
│ │ │ ├── BigNumberTimeConverter.php
│ │ │ ├── DegradedTimeConverter.php
│ │ │ ├── GenericTimeConverter.php
│ │ │ ├── PhpTimeConverter.php
│ │ │ └── UnixTimeConverter.php
│ │ └── TimeConverterInterface.php
│ ├── DegradedUuid.php
│ ├── DeprecatedUuidInterface.php
│ ├── DeprecatedUuidMethodsTrait.php
│ ├── Exception/
│ │ ├── BuilderNotFoundException.php
│ │ ├── DateTimeException.php
│ │ ├── DceSecurityException.php
│ │ ├── InvalidArgumentException.php
│ │ ├── InvalidBytesException.php
│ │ ├── InvalidUuidStringException.php
│ │ ├── NameException.php
│ │ ├── NodeException.php
│ │ ├── RandomSourceException.php
│ │ ├── TimeSourceException.php
│ │ ├── UnableToBuildUuidException.php
│ │ ├── UnsupportedOperationException.php
│ │ └── UuidExceptionInterface.php
│ ├── FeatureSet.php
│ ├── Fields/
│ │ ├── FieldsInterface.php
│ │ └── SerializableFieldsTrait.php
│ ├── Generator/
│ │ ├── CombGenerator.php
│ │ ├── DceSecurityGenerator.php
│ │ ├── DceSecurityGeneratorInterface.php
│ │ ├── DefaultNameGenerator.php
│ │ ├── DefaultTimeGenerator.php
│ │ ├── NameGeneratorFactory.php
│ │ ├── NameGeneratorInterface.php
│ │ ├── PeclUuidNameGenerator.php
│ │ ├── PeclUuidRandomGenerator.php
│ │ ├── PeclUuidTimeGenerator.php
│ │ ├── RandomBytesGenerator.php
│ │ ├── RandomGeneratorFactory.php
│ │ ├── RandomGeneratorInterface.php
│ │ ├── RandomLibAdapter.php
│ │ ├── TimeGeneratorFactory.php
│ │ ├── TimeGeneratorInterface.php
│ │ └── UnixTimeGenerator.php
│ ├── Guid/
│ │ ├── Fields.php
│ │ ├── Guid.php
│ │ └── GuidBuilder.php
│ ├── Lazy/
│ │ └── LazyUuidFromString.php
│ ├── Math/
│ │ ├── BrickMathCalculator.php
│ │ ├── CalculatorInterface.php
│ │ └── RoundingMode.php
│ ├── Nonstandard/
│ │ ├── Fields.php
│ │ ├── Uuid.php
│ │ ├── UuidBuilder.php
│ │ └── UuidV6.php
│ ├── Provider/
│ │ ├── Dce/
│ │ │ └── SystemDceSecurityProvider.php
│ │ ├── DceSecurityProviderInterface.php
│ │ ├── Node/
│ │ │ ├── FallbackNodeProvider.php
│ │ │ ├── NodeProviderCollection.php
│ │ │ ├── RandomNodeProvider.php
│ │ │ ├── StaticNodeProvider.php
│ │ │ └── SystemNodeProvider.php
│ │ ├── NodeProviderInterface.php
│ │ ├── Time/
│ │ │ ├── FixedTimeProvider.php
│ │ │ └── SystemTimeProvider.php
│ │ └── TimeProviderInterface.php
│ ├── Rfc4122/
│ │ ├── Fields.php
│ │ ├── FieldsInterface.php
│ │ ├── MaxTrait.php
│ │ ├── MaxUuid.php
│ │ ├── NilTrait.php
│ │ ├── NilUuid.php
│ │ ├── TimeTrait.php
│ │ ├── UuidBuilder.php
│ │ ├── UuidInterface.php
│ │ ├── UuidV1.php
│ │ ├── UuidV2.php
│ │ ├── UuidV3.php
│ │ ├── UuidV4.php
│ │ ├── UuidV5.php
│ │ ├── UuidV6.php
│ │ ├── UuidV7.php
│ │ ├── UuidV8.php
│ │ ├── Validator.php
│ │ ├── VariantTrait.php
│ │ └── VersionTrait.php
│ ├── Type/
│ │ ├── Decimal.php
│ │ ├── Hexadecimal.php
│ │ ├── Integer.php
│ │ ├── NumberInterface.php
│ │ ├── Time.php
│ │ └── TypeInterface.php
│ ├── Uuid.php
│ ├── UuidFactory.php
│ ├── UuidFactoryInterface.php
│ ├── UuidInterface.php
│ ├── Validator/
│ │ ├── GenericValidator.php
│ │ └── ValidatorInterface.php
│ └── functions.php
└── tests/
├── BinaryUtilsTest.php
├── Builder/
│ ├── DefaultUuidBuilderTest.php
│ └── FallbackBuilderTest.php
├── Codec/
│ ├── GuidStringCodecTest.php
│ ├── OrderedTimeCodecTest.php
│ └── StringCodecTest.php
├── Converter/
│ ├── Number/
│ │ ├── BigNumberConverterTest.php
│ │ └── GenericNumberConverterTest.php
│ └── Time/
│ ├── BigNumberTimeConverterTest.php
│ ├── GenericTimeConverterTest.php
│ ├── PhpTimeConverterTest.php
│ └── UnixTimeConverterTest.php
├── DeprecatedUuidMethodsTraitTest.php
├── Encoder/
│ ├── TimestampFirstCombCodecTest.php
│ └── TimestampLastCombCodecTest.php
├── ExpectedBehaviorTest.php
├── FeatureSetTest.php
├── FunctionsTest.php
├── Generator/
│ ├── CombGeneratorTest.php
│ ├── DceSecurityGeneratorTest.php
│ ├── DefaultNameGeneratorTest.php
│ ├── DefaultTimeGeneratorTest.php
│ ├── NameGeneratorFactoryTest.php
│ ├── PeclUuidNameGeneratorTest.php
│ ├── PeclUuidRandomGeneratorTest.php
│ ├── PeclUuidTimeGeneratorTest.php
│ ├── RandomBytesGeneratorTest.php
│ ├── RandomGeneratorFactoryTest.php
│ ├── RandomLibAdapterTest.php
│ ├── TimeGeneratorFactoryTest.php
│ └── UnixTimeGeneratorTest.php
├── Guid/
│ ├── FieldsTest.php
│ └── GuidBuilderTest.php
├── Math/
│ └── BrickMathCalculatorTest.php
├── Nonstandard/
│ ├── FieldsTest.php
│ ├── UuidBuilderTest.php
│ └── UuidV6Test.php
├── Provider/
│ ├── Dce/
│ │ └── SystemDceSecurityProviderTest.php
│ ├── Node/
│ │ ├── FallbackNodeProviderTest.php
│ │ ├── RandomNodeProviderTest.php
│ │ ├── StaticNodeProviderTest.php
│ │ └── SystemNodeProviderTest.php
│ └── Time/
│ ├── FixedTimeProviderTest.php
│ └── SystemTimeProviderTest.php
├── Rfc4122/
│ ├── FieldsTest.php
│ ├── UuidBuilderTest.php
│ ├── UuidV1Test.php
│ ├── UuidV2Test.php
│ ├── UuidV3Test.php
│ ├── UuidV4Test.php
│ ├── UuidV5Test.php
│ ├── UuidV6Test.php
│ ├── UuidV7Test.php
│ ├── UuidV8Test.php
│ ├── ValidatorTest.php
│ └── VariantTraitTest.php
├── TestCase.php
├── Type/
│ ├── DecimalTest.php
│ ├── HexadecimalTest.php
│ ├── IntegerTest.php
│ └── TimeTest.php
├── UuidFactoryTest.php
├── UuidTest.php
├── Validator/
│ └── GenericValidatorTest.php
├── benchmark/
│ ├── GuidConversionBench.php
│ ├── NonLazyUuidConversionBench.php
│ ├── UuidFieldExtractionBench.php
│ ├── UuidGenerationBench.php
│ ├── UuidSerializationBench.php
│ └── UuidStringConversionBench.php
├── bootstrap.php
└── static-analysis/
├── UuidIsImmutable.php
├── UuidIsNeverEmpty.php
├── ValidUuidIsNonEmpty.php
└── stubs.php
SYMBOL INDEX (1195 symbols across 188 files)
FILE: docs/conf.py
function get_version (line 22) | def get_version():
FILE: src/BinaryUtils.php
class BinaryUtils (line 20) | class BinaryUtils
method applyVariant (line 33) | public static function applyVariant(int $clockSeq): int
method applyVersion (line 50) | public static function applyVersion(int $timeHi, int $version): int
FILE: src/Builder/BuilderCollection.php
class BuilderCollection (line 37) | class BuilderCollection extends AbstractCollection
method getType (line 39) | public function getType(): string
method getIterator (line 44) | public function getIterator(): Traversable
method unserialize (line 54) | public function unserialize($serialized): void
FILE: src/Builder/DefaultUuidBuilder.php
class DefaultUuidBuilder (line 24) | class DefaultUuidBuilder extends Rfc4122UuidBuilder
FILE: src/Builder/DegradedUuidBuilder.php
class DegradedUuidBuilder (line 30) | class DegradedUuidBuilder implements UuidBuilderInterface
method __construct (line 39) | public function __construct(
method build (line 56) | public function build(CodecInterface $codec, string $bytes): UuidInter...
FILE: src/Builder/FallbackBuilder.php
class FallbackBuilder (line 27) | class FallbackBuilder implements UuidBuilderInterface
method __construct (line 32) | public function __construct(private iterable $builders)
method build (line 46) | public function build(CodecInterface $codec, string $bytes): UuidInter...
FILE: src/Builder/UuidBuilderInterface.php
type UuidBuilderInterface (line 25) | interface UuidBuilderInterface
method build (line 37) | public function build(CodecInterface $codec, string $bytes): UuidInter...
FILE: src/Codec/CodecInterface.php
type CodecInterface (line 24) | interface CodecInterface
method encode (line 35) | public function encode(UuidInterface $uuid): string;
method encodeBinary (line 46) | public function encodeBinary(UuidInterface $uuid): string;
method decode (line 57) | public function decode(string $encodedUuid): UuidInterface;
method decodeBytes (line 68) | public function decodeBytes(string $bytes): UuidInterface;
FILE: src/Codec/GuidStringCodec.php
class GuidStringCodec (line 31) | class GuidStringCodec extends StringCodec
method encode (line 33) | public function encode(UuidInterface $uuid): string
method decode (line 54) | public function decode(string $encodedUuid): UuidInterface
method decodeBytes (line 63) | public function decodeBytes(string $bytes): UuidInterface
method swapBytes (line 72) | private function swapBytes(string $bytes): string
FILE: src/Codec/OrderedTimeCodec.php
class OrderedTimeCodec (line 44) | class OrderedTimeCodec extends StringCodec
method encodeBinary (line 51) | public function encodeBinary(UuidInterface $uuid): string
method decodeBytes (line 77) | public function decodeBytes(string $bytes): UuidInterface
FILE: src/Codec/StringCodec.php
class StringCodec (line 36) | class StringCodec implements CodecInterface
method __construct (line 43) | public function __construct(private UuidBuilderInterface $builder)
method encode (line 47) | public function encode(UuidInterface $uuid): string
method encodeBinary (line 66) | public function encodeBinary(UuidInterface $uuid): string
method decode (line 77) | public function decode(string $encodedUuid): UuidInterface
method decodeBytes (line 83) | public function decodeBytes(string $bytes): UuidInterface
method getBuilder (line 95) | protected function getBuilder(): UuidBuilderInterface
method getBytes (line 103) | protected function getBytes(string $encodedUuid): string
FILE: src/Codec/TimestampFirstCombCodec.php
class TimestampFirstCombCodec (line 51) | class TimestampFirstCombCodec extends StringCodec
method encode (line 56) | public function encode(UuidInterface $uuid): string
method encodeBinary (line 74) | public function encodeBinary(UuidInterface $uuid): string
method decode (line 85) | public function decode(string $encodedUuid): UuidInterface
method decodeBytes (line 94) | public function decodeBytes(string $bytes): UuidInterface
method swapBytes (line 105) | private function swapBytes(string $bytes): string
FILE: src/Codec/TimestampLastCombCodec.php
class TimestampLastCombCodec (line 46) | class TimestampLastCombCodec extends StringCodec
FILE: src/Converter/Number/BigNumberConverter.php
class BigNumberConverter (line 28) | class BigNumberConverter implements NumberConverterInterface
method __construct (line 32) | public function __construct()
method fromHex (line 40) | public function fromHex(string $hex): string
method toHex (line 48) | public function toHex(string $number): string
FILE: src/Converter/Number/DegradedNumberConverter.php
class DegradedNumberConverter (line 23) | class DegradedNumberConverter extends BigNumberConverter
FILE: src/Converter/Number/GenericNumberConverter.php
class GenericNumberConverter (line 26) | class GenericNumberConverter implements NumberConverterInterface
method __construct (line 28) | public function __construct(private CalculatorInterface $calculator)
method fromHex (line 35) | public function fromHex(string $hex): string
method toHex (line 43) | public function toHex(string $number): string
FILE: src/Converter/NumberConverterInterface.php
type NumberConverterInterface (line 22) | interface NumberConverterInterface
method fromHex (line 36) | public function fromHex(string $hex): string;
method toHex (line 48) | public function toHex(string $number): string;
FILE: src/Converter/Time/BigNumberTimeConverter.php
class BigNumberTimeConverter (line 30) | class BigNumberTimeConverter implements TimeConverterInterface
method __construct (line 34) | public function __construct()
method calculateTime (line 39) | public function calculateTime(string $seconds, string $microseconds): ...
method convertTime (line 44) | public function convertTime(Hexadecimal $uuidTimestamp): Time
FILE: src/Converter/Time/DegradedTimeConverter.php
class DegradedTimeConverter (line 23) | class DegradedTimeConverter extends BigNumberTimeConverter
FILE: src/Converter/Time/GenericTimeConverter.php
class GenericTimeConverter (line 34) | class GenericTimeConverter implements TimeConverterInterface
method __construct (line 51) | public function __construct(private CalculatorInterface $calculator)
method calculateTime (line 55) | public function calculateTime(string $seconds, string $microseconds): ...
method convertTime (line 90) | public function convertTime(Hexadecimal $uuidTimestamp): Time
FILE: src/Converter/Time/PhpTimeConverter.php
class PhpTimeConverter (line 42) | class PhpTimeConverter implements TimeConverterInterface
method __construct (line 63) | public function __construct(
method calculateTime (line 80) | public function calculateTime(string $seconds, string $microseconds): ...
method convertTime (line 107) | public function convertTime(Hexadecimal $uuidTimestamp): Time
method splitTime (line 131) | private function splitTime(float | int $time): array
FILE: src/Converter/Time/UnixTimeConverter.php
class UnixTimeConverter (line 35) | class UnixTimeConverter implements TimeConverterInterface
method __construct (line 39) | public function __construct(private CalculatorInterface $calculator)
method calculateTime (line 43) | public function calculateTime(string $seconds, string $microseconds): ...
method convertTime (line 76) | public function convertTime(Hexadecimal $uuidTimestamp): Time
FILE: src/Converter/TimeConverterInterface.php
type TimeConverterInterface (line 25) | interface TimeConverterInterface
method calculateTime (line 40) | public function calculateTime(string $seconds, string $microseconds): ...
method convertTime (line 52) | public function convertTime(Hexadecimal $uuidTimestamp): Time;
FILE: src/DegradedUuid.php
class DegradedUuid (line 23) | class DegradedUuid extends Uuid
FILE: src/DeprecatedUuidInterface.php
type DeprecatedUuidInterface (line 25) | interface DeprecatedUuidInterface
method getNumberConverter (line 30) | public function getNumberConverter(): NumberConverterInterface;
method getFieldsHex (line 37) | public function getFieldsHex(): array;
method getClockSeqHiAndReservedHex (line 44) | public function getClockSeqHiAndReservedHex(): string;
method getClockSeqLowHex (line 51) | public function getClockSeqLowHex(): string;
method getClockSequenceHex (line 58) | public function getClockSequenceHex(): string;
method getDateTime (line 64) | public function getDateTime(): DateTimeInterface;
method getLeastSignificantBitsHex (line 70) | public function getLeastSignificantBitsHex(): string;
method getMostSignificantBitsHex (line 76) | public function getMostSignificantBitsHex(): string;
method getNodeHex (line 83) | public function getNodeHex(): string;
method getTimeHiAndVersionHex (line 90) | public function getTimeHiAndVersionHex(): string;
method getTimeLowHex (line 97) | public function getTimeLowHex(): string;
method getTimeMidHex (line 104) | public function getTimeMidHex(): string;
method getTimestampHex (line 111) | public function getTimestampHex(): string;
method getVariant (line 118) | public function getVariant(): ?int;
method getVersion (line 125) | public function getVersion(): ?int;
FILE: src/DeprecatedUuidMethodsTrait.php
type DeprecatedUuidMethodsTrait (line 36) | trait DeprecatedUuidMethodsTrait
method getClockSeqHiAndReserved (line 44) | public function getClockSeqHiAndReserved(): string
method getClockSeqHiAndReservedHex (line 54) | public function getClockSeqHiAndReservedHex(): string
method getClockSeqLow (line 65) | public function getClockSeqLow(): string
method getClockSeqLowHex (line 75) | public function getClockSeqLowHex(): string
method getClockSequence (line 86) | public function getClockSequence(): string
method getClockSequenceHex (line 96) | public function getClockSequenceHex(): string
method getNumberConverter (line 104) | public function getNumberConverter(): NumberConverterInterface
method getDateTime (line 117) | public function getDateTime(): DateTimeInterface
method getFieldsHex (line 142) | public function getFieldsHex(): array
method getLeastSignificantBits (line 158) | public function getLeastSignificantBits(): string
method getLeastSignificantBitsHex (line 169) | public function getLeastSignificantBitsHex(): string
method getMostSignificantBits (line 178) | public function getMostSignificantBits(): string
method getMostSignificantBitsHex (line 189) | public function getMostSignificantBitsHex(): string
method getNode (line 200) | public function getNode(): string
method getNodeHex (line 210) | public function getNodeHex(): string
method getTimeHiAndVersion (line 221) | public function getTimeHiAndVersion(): string
method getTimeHiAndVersionHex (line 231) | public function getTimeHiAndVersionHex(): string
method getTimeLow (line 242) | public function getTimeLow(): string
method getTimeLowHex (line 252) | public function getTimeLowHex(): string
method getTimeMid (line 263) | public function getTimeMid(): string
method getTimeMidHex (line 273) | public function getTimeMidHex(): string
method getTimestamp (line 284) | public function getTimestamp(): string
method getTimestampHex (line 298) | public function getTimestampHex(): string
method getVariant (line 312) | public function getVariant(): ?int
method getVersion (line 322) | public function getVersion(): ?int
FILE: src/Exception/BuilderNotFoundException.php
class BuilderNotFoundException (line 22) | class BuilderNotFoundException extends PhpRuntimeException implements Uu...
FILE: src/Exception/DateTimeException.php
class DateTimeException (line 22) | class DateTimeException extends PhpRuntimeException implements UuidExcep...
FILE: src/Exception/DceSecurityException.php
class DceSecurityException (line 22) | class DceSecurityException extends PhpRuntimeException implements UuidEx...
FILE: src/Exception/InvalidArgumentException.php
class InvalidArgumentException (line 22) | class InvalidArgumentException extends PhpInvalidArgumentException imple...
FILE: src/Exception/InvalidBytesException.php
class InvalidBytesException (line 22) | class InvalidBytesException extends PhpRuntimeException implements UuidE...
FILE: src/Exception/InvalidUuidStringException.php
class InvalidUuidStringException (line 23) | class InvalidUuidStringException extends InvalidArgumentException implem...
FILE: src/Exception/NameException.php
class NameException (line 22) | class NameException extends PhpRuntimeException implements UuidException...
FILE: src/Exception/NodeException.php
class NodeException (line 22) | class NodeException extends PhpRuntimeException implements UuidException...
FILE: src/Exception/RandomSourceException.php
class RandomSourceException (line 25) | class RandomSourceException extends PhpRuntimeException implements UuidE...
FILE: src/Exception/TimeSourceException.php
class TimeSourceException (line 22) | class TimeSourceException extends PhpRuntimeException implements UuidExc...
FILE: src/Exception/UnableToBuildUuidException.php
class UnableToBuildUuidException (line 22) | class UnableToBuildUuidException extends PhpRuntimeException implements ...
FILE: src/Exception/UnsupportedOperationException.php
class UnsupportedOperationException (line 22) | class UnsupportedOperationException extends PhpLogicException implements...
FILE: src/Exception/UuidExceptionInterface.php
type UuidExceptionInterface (line 19) | interface UuidExceptionInterface extends Throwable
FILE: src/FeatureSet.php
class FeatureSet (line 62) | class FeatureSet
method __construct (line 87) | public function __construct(
method getBuilder (line 111) | public function getBuilder(): UuidBuilderInterface
method getCalculator (line 119) | public function getCalculator(): CalculatorInterface
method getCodec (line 127) | public function getCodec(): CodecInterface
method getDceSecurityGenerator (line 135) | public function getDceSecurityGenerator(): DceSecurityGeneratorInterface
method getNameGenerator (line 143) | public function getNameGenerator(): NameGeneratorInterface
method getNodeProvider (line 151) | public function getNodeProvider(): NodeProviderInterface
method getNumberConverter (line 159) | public function getNumberConverter(): NumberConverterInterface
method getRandomGenerator (line 167) | public function getRandomGenerator(): RandomGeneratorInterface
method getTimeConverter (line 175) | public function getTimeConverter(): TimeConverterInterface
method getTimeGenerator (line 183) | public function getTimeGenerator(): TimeGeneratorInterface
method getUnixTimeGenerator (line 191) | public function getUnixTimeGenerator(): TimeGeneratorInterface
method getValidator (line 199) | public function getValidator(): ValidatorInterface
method setCalculator (line 207) | public function setCalculator(CalculatorInterface $calculator): void
method setDceSecurityProvider (line 221) | public function setDceSecurityProvider(DceSecurityProviderInterface $d...
method setNodeProvider (line 229) | public function setNodeProvider(NodeProviderInterface $nodeProvider): ...
method setTimeProvider (line 241) | public function setTimeProvider(TimeProviderInterface $timeProvider): ...
method setValidator (line 250) | public function setValidator(ValidatorInterface $validator): void
method buildCodec (line 260) | private function buildCodec(bool $useGuids = false): CodecInterface
method buildDceSecurityGenerator (line 272) | private function buildDceSecurityGenerator(
method buildNodeProvider (line 281) | private function buildNodeProvider(): NodeProviderInterface
method buildNumberConverter (line 293) | private function buildNumberConverter(CalculatorInterface $calculator)...
method buildRandomGenerator (line 301) | private function buildRandomGenerator(): RandomGeneratorInterface
method buildTimeGenerator (line 316) | private function buildTimeGenerator(TimeProviderInterface $timeProvide...
method buildUnixTimeGenerator (line 328) | private function buildUnixTimeGenerator(): TimeGeneratorInterface
method buildNameGenerator (line 336) | private function buildNameGenerator(): NameGeneratorInterface
method buildTimeConverter (line 348) | private function buildTimeConverter(CalculatorInterface $calculator): ...
method buildUuidBuilder (line 364) | private function buildUuidBuilder(bool $useGuids = false): UuidBuilder...
method is64BitSystem (line 379) | private function is64BitSystem(): bool
FILE: src/Fields/FieldsInterface.php
type FieldsInterface (line 25) | interface FieldsInterface extends Serializable
method getBytes (line 32) | public function getBytes(): string;
FILE: src/Fields/SerializableFieldsTrait.php
type SerializableFieldsTrait (line 28) | trait SerializableFieldsTrait
method __construct (line 33) | abstract public function __construct(string $bytes);
method getBytes (line 38) | abstract public function getBytes(): string;
method serialize (line 43) | public function serialize(): string
method __serialize (line 51) | public function __serialize(): array
method unserialize (line 61) | public function unserialize(string $data): void
method __unserialize (line 73) | public function __unserialize(array $data): void
FILE: src/Generator/CombGenerator.php
class CombGenerator (line 59) | class CombGenerator implements RandomGeneratorInterface
method __construct (line 63) | public function __construct(
method generate (line 74) | public function generate(int $length): string
method timestamp (line 106) | private function timestamp(): string
FILE: src/Generator/DceSecurityGenerator.php
class DceSecurityGenerator (line 37) | class DceSecurityGenerator implements DceSecurityGeneratorInterface
method __construct (line 55) | public function __construct(
method generate (line 62) | public function generate(
FILE: src/Generator/DceSecurityGeneratorInterface.php
type DceSecurityGeneratorInterface (line 27) | interface DceSecurityGeneratorInterface
method generate (line 42) | public function generate(
FILE: src/Generator/DefaultNameGenerator.php
class DefaultNameGenerator (line 26) | class DefaultNameGenerator implements NameGeneratorInterface
method generate (line 31) | public function generate(UuidInterface $ns, string $name, string $hash...
FILE: src/Generator/DefaultTimeGenerator.php
class DefaultTimeGenerator (line 40) | class DefaultTimeGenerator implements TimeGeneratorInterface
method __construct (line 42) | public function __construct(
method generate (line 55) | public function generate($node = null, ?int $clockSeq = null): string
method getValidNode (line 101) | private function getValidNode(int | string | null $node): string
FILE: src/Generator/NameGeneratorFactory.php
class NameGeneratorFactory (line 20) | class NameGeneratorFactory
method getGenerator (line 25) | public function getGenerator(): NameGeneratorInterface
FILE: src/Generator/NameGeneratorInterface.php
type NameGeneratorInterface (line 23) | interface NameGeneratorInterface
method generate (line 36) | public function generate(UuidInterface $ns, string $name, string $hash...
FILE: src/Generator/PeclUuidNameGenerator.php
class PeclUuidNameGenerator (line 30) | class PeclUuidNameGenerator implements NameGeneratorInterface
method generate (line 35) | public function generate(UuidInterface $ns, string $name, string $hash...
FILE: src/Generator/PeclUuidRandomGenerator.php
class PeclUuidRandomGenerator (line 27) | class PeclUuidRandomGenerator implements RandomGeneratorInterface
method generate (line 29) | public function generate(int $length): string
FILE: src/Generator/PeclUuidTimeGenerator.php
class PeclUuidTimeGenerator (line 27) | class PeclUuidTimeGenerator implements TimeGeneratorInterface
method generate (line 32) | public function generate($node = null, ?int $clockSeq = null): string
FILE: src/Generator/RandomBytesGenerator.php
class RandomBytesGenerator (line 25) | class RandomBytesGenerator implements RandomGeneratorInterface
method generate (line 32) | public function generate(int $length): string
FILE: src/Generator/RandomGeneratorFactory.php
class RandomGeneratorFactory (line 20) | class RandomGeneratorFactory
method getGenerator (line 25) | public function getGenerator(): RandomGeneratorInterface
FILE: src/Generator/RandomGeneratorInterface.php
type RandomGeneratorInterface (line 20) | interface RandomGeneratorInterface
method generate (line 29) | public function generate(int $length): string;
FILE: src/Generator/RandomLibAdapter.php
class RandomLibAdapter (line 28) | class RandomLibAdapter implements RandomGeneratorInterface
method __construct (line 40) | public function __construct(?Generator $generator = null)
method generate (line 50) | public function generate(int $length): string
FILE: src/Generator/TimeGeneratorFactory.php
class TimeGeneratorFactory (line 24) | class TimeGeneratorFactory
method __construct (line 26) | public function __construct(
method getGenerator (line 36) | public function getGenerator(): TimeGeneratorInterface
FILE: src/Generator/TimeGeneratorInterface.php
type TimeGeneratorInterface (line 22) | interface TimeGeneratorInterface
method generate (line 34) | public function generate($node = null, ?int $clockSeq = null): string;
FILE: src/Generator/UnixTimeGenerator.php
class UnixTimeGenerator (line 45) | class UnixTimeGenerator implements TimeGeneratorInterface
method __construct (line 57) | public function __construct(
method generate (line 68) | public function generate($node = null, ?int $clockSeq = null, ?DateTim...
method randomize (line 94) | private function randomize(string $time): void
method increment (line 124) | private function increment(): string
FILE: src/Guid/Fields.php
class Fields (line 46) | final class Fields implements FieldsInterface
method __construct (line 61) | public function __construct(private string $bytes)
method getBytes (line 81) | public function getBytes(): string
method getTimeLow (line 86) | public function getTimeLow(): Hexadecimal
method getTimeMid (line 102) | public function getTimeMid(): Hexadecimal
method getTimeHiAndVersion (line 111) | public function getTimeHiAndVersion(): Hexadecimal
method getTimestamp (line 120) | public function getTimestamp(): Hexadecimal
method getClockSeq (line 130) | public function getClockSeq(): Hexadecimal
method getClockSeqHiAndReserved (line 143) | public function getClockSeqHiAndReserved(): Hexadecimal
method getClockSeqLow (line 148) | public function getClockSeqLow(): Hexadecimal
method getNode (line 153) | public function getNode(): Hexadecimal
method getVersion (line 158) | public function getVersion(): ?int
method isCorrectVariant (line 170) | private function isCorrectVariant(): bool
FILE: src/Guid/Guid.php
class Guid (line 47) | final class Guid extends Uuid
method __construct (line 49) | public function __construct(
FILE: src/Guid/GuidBuilder.php
class GuidBuilder (line 32) | class GuidBuilder implements UuidBuilderInterface
method __construct (line 39) | public function __construct(
method build (line 55) | public function build(CodecInterface $codec, string $bytes): UuidInter...
method buildFields (line 71) | protected function buildFields(string $bytes): Fields
FILE: src/Lazy/LazyUuidFromString.php
class LazyUuidFromString (line 51) | final class LazyUuidFromString implements UuidInterface
method __construct (line 60) | public function __construct(private string $uuid)
method fromBytes (line 64) | public static function fromBytes(string $bytes): self
method serialize (line 81) | public function serialize(): string
method __serialize (line 89) | public function __serialize(): array
method unserialize (line 99) | public function unserialize(string $data): void
method __unserialize (line 107) | public function __unserialize(array $data): void
method getNumberConverter (line 118) | public function getNumberConverter(): NumberConverterInterface
method getFieldsHex (line 126) | public function getFieldsHex(): array
method getClockSeqHiAndReservedHex (line 131) | public function getClockSeqHiAndReservedHex(): string
method getClockSeqLowHex (line 136) | public function getClockSeqLowHex(): string
method getClockSequenceHex (line 141) | public function getClockSequenceHex(): string
method getDateTime (line 146) | public function getDateTime(): DateTimeInterface
method getLeastSignificantBitsHex (line 151) | public function getLeastSignificantBitsHex(): string
method getMostSignificantBitsHex (line 156) | public function getMostSignificantBitsHex(): string
method getNodeHex (line 161) | public function getNodeHex(): string
method getTimeHiAndVersionHex (line 166) | public function getTimeHiAndVersionHex(): string
method getTimeLowHex (line 171) | public function getTimeLowHex(): string
method getTimeMidHex (line 176) | public function getTimeMidHex(): string
method getTimestampHex (line 181) | public function getTimestampHex(): string
method getUrn (line 186) | public function getUrn(): string
method getVariant (line 191) | public function getVariant(): ?int
method getVersion (line 196) | public function getVersion(): ?int
method compareTo (line 201) | public function compareTo(UuidInterface $other): int
method equals (line 206) | public function equals(?object $other): bool
method getBytes (line 215) | public function getBytes(): string
method getFields (line 224) | public function getFields(): FieldsInterface
method getHex (line 229) | public function getHex(): Hexadecimal
method getInteger (line 234) | public function getInteger(): IntegerObject
method toString (line 239) | public function toString(): string
method __toString (line 244) | public function __toString(): string
method jsonSerialize (line 249) | public function jsonSerialize(): string
method getClockSeqHiAndReserved (line 259) | public function getClockSeqHiAndReserved(): string
method getClockSeqLow (line 274) | public function getClockSeqLow(): string
method getClockSequence (line 289) | public function getClockSequence(): string
method getLeastSignificantBits (line 303) | public function getLeastSignificantBits(): string
method getMostSignificantBits (line 314) | public function getMostSignificantBits(): string
method getNode (line 326) | public function getNode(): string
method getTimeHiAndVersion (line 341) | public function getTimeHiAndVersion(): string
method getTimeLow (line 356) | public function getTimeLow(): string
method getTimeMid (line 371) | public function getTimeMid(): string
method getTimestamp (line 386) | public function getTimestamp(): string
method toUuidV1 (line 400) | public function toUuidV1(): UuidV1
method toUuidV6 (line 413) | public function toUuidV6(): UuidV6
method unwrap (line 422) | private function unwrap(): UuidInterface
FILE: src/Math/BrickMathCalculator.php
class BrickMathCalculator (line 32) | final class BrickMathCalculator implements CalculatorInterface
method add (line 47) | public function add(NumberInterface $augend, NumberInterface ...$adden...
method subtract (line 59) | public function subtract(NumberInterface $minuend, NumberInterface ......
method multiply (line 71) | public function multiply(NumberInterface $multiplicand, NumberInterfac...
method divide (line 83) | public function divide(
method fromBase (line 107) | public function fromBase(string $value, int $base): IntegerObject
method toBase (line 121) | public function toBase(IntegerObject $value, int $base): string
method toHexadecimal (line 134) | public function toHexadecimal(IntegerObject $value): Hexadecimal
method toInteger (line 140) | public function toInteger(Hexadecimal $value): IntegerObject
method getBrickRoundingMode (line 150) | private function getBrickRoundingMode(int $roundingMode)
FILE: src/Math/CalculatorInterface.php
type CalculatorInterface (line 26) | interface CalculatorInterface
method add (line 38) | public function add(NumberInterface $augend, NumberInterface ...$adden...
method subtract (line 50) | public function subtract(NumberInterface $minuend, NumberInterface ......
method multiply (line 62) | public function multiply(NumberInterface $multiplicand, NumberInterfac...
method divide (line 77) | public function divide(
method fromBase (line 94) | public function fromBase(string $value, int $base): IntegerObject;
method toBase (line 106) | public function toBase(IntegerObject $value, int $base): string;
method toHexadecimal (line 113) | public function toHexadecimal(IntegerObject $value): Hexadecimal;
method toInteger (line 120) | public function toInteger(Hexadecimal $value): IntegerObject;
FILE: src/Math/RoundingMode.php
class RoundingMode (line 41) | final class RoundingMode
method __construct (line 124) | private function __construct()
FILE: src/Nonstandard/Fields.php
class Fields (line 43) | final class Fields implements FieldsInterface
method __construct (line 53) | public function __construct(private string $bytes)
method getBytes (line 62) | public function getBytes(): string
method getClockSeq (line 67) | public function getClockSeq(): Hexadecimal
method getClockSeqHiAndReserved (line 74) | public function getClockSeqHiAndReserved(): Hexadecimal
method getClockSeqLow (line 79) | public function getClockSeqLow(): Hexadecimal
method getNode (line 84) | public function getNode(): Hexadecimal
method getTimeHiAndVersion (line 89) | public function getTimeHiAndVersion(): Hexadecimal
method getTimeLow (line 94) | public function getTimeLow(): Hexadecimal
method getTimeMid (line 99) | public function getTimeMid(): Hexadecimal
method getTimestamp (line 104) | public function getTimestamp(): Hexadecimal
method getVersion (line 114) | public function getVersion(): ?int
method isNil (line 119) | public function isNil(): bool
method isMax (line 124) | public function isMax(): bool
FILE: src/Nonstandard/Uuid.php
class Uuid (line 28) | final class Uuid extends BaseUuid
method __construct (line 30) | public function __construct(
FILE: src/Nonstandard/UuidBuilder.php
class UuidBuilder (line 30) | class UuidBuilder implements UuidBuilderInterface
method __construct (line 37) | public function __construct(
method build (line 53) | public function build(CodecInterface $codec, string $bytes): UuidInter...
method buildFields (line 69) | protected function buildFields(string $bytes): Fields
FILE: src/Nonstandard/UuidV6.php
class UuidV6 (line 40) | class UuidV6 extends BaseUuid implements UuidInterface
method __construct (line 53) | public function __construct(
method toUuidV1 (line 71) | public function toUuidV1(): UuidV1
method fromUuidV1 (line 89) | public static function fromUuidV1(UuidV1 $uuidV1): \Ramsey\Uuid\Rfc412...
FILE: src/Provider/Dce/SystemDceSecurityProvider.php
class SystemDceSecurityProvider (line 35) | class SystemDceSecurityProvider implements DceSecurityProviderInterface
method getUid (line 42) | public function getUid(): IntegerObject
method getGid (line 72) | public function getGid(): IntegerObject
method getSystemUid (line 100) | private function getSystemUid(): string
method getSystemGid (line 115) | private function getSystemGid(): string
method hasShellExec (line 130) | private function hasShellExec(): bool
method getOs (line 138) | private function getOs(): string
method getWindowsUid (line 159) | private function getWindowsUid(): string
method getWindowsGid (line 186) | private function getWindowsGid(): string
FILE: src/Provider/DceSecurityProviderInterface.php
type DceSecurityProviderInterface (line 25) | interface DceSecurityProviderInterface
method getUid (line 32) | public function getUid(): IntegerObject;
method getGid (line 39) | public function getGid(): IntegerObject;
FILE: src/Provider/Node/FallbackNodeProvider.php
class FallbackNodeProvider (line 24) | class FallbackNodeProvider implements NodeProviderInterface
method __construct (line 29) | public function __construct(private iterable $providers)
method getNode (line 33) | public function getNode(): Hexadecimal
FILE: src/Provider/Node/NodeProviderCollection.php
class NodeProviderCollection (line 31) | class NodeProviderCollection extends AbstractCollection
method getType (line 33) | public function getType(): string
method unserialize (line 43) | public function unserialize($serialized): void
FILE: src/Provider/Node/RandomNodeProvider.php
class RandomNodeProvider (line 36) | class RandomNodeProvider implements NodeProviderInterface
method getNode (line 38) | public function getNode(): Hexadecimal
FILE: src/Provider/Node/StaticNodeProvider.php
class StaticNodeProvider (line 33) | class StaticNodeProvider implements NodeProviderInterface
method __construct (line 40) | public function __construct(Hexadecimal $node)
method getNode (line 49) | public function getNode(): Hexadecimal
method setMulticastBit (line 57) | private function setMulticastBit(Hexadecimal $node): Hexadecimal
FILE: src/Provider/Node/SystemNodeProvider.php
class SystemNodeProvider (line 44) | class SystemNodeProvider implements NodeProviderInterface
method getNode (line 56) | public function getNode(): Hexadecimal
method getNodeFromSystem (line 70) | protected function getNodeFromSystem(): string
method getIfconfig (line 97) | protected function getIfconfig(): string
method getSysfs (line 143) | protected function getSysfs(): string
FILE: src/Provider/NodeProviderInterface.php
type NodeProviderInterface (line 22) | interface NodeProviderInterface
method getNode (line 29) | public function getNode(): Hexadecimal;
FILE: src/Provider/Time/FixedTimeProvider.php
class FixedTimeProvider (line 26) | class FixedTimeProvider implements TimeProviderInterface
method __construct (line 28) | public function __construct(private Time $time)
method setUsec (line 37) | public function setUsec($value): void
method setSec (line 47) | public function setSec($value): void
method getTime (line 52) | public function getTime(): Time
FILE: src/Provider/Time/SystemTimeProvider.php
class SystemTimeProvider (line 25) | class SystemTimeProvider implements TimeProviderInterface
method getTime (line 27) | public function getTime(): Time
FILE: src/Provider/TimeProviderInterface.php
type TimeProviderInterface (line 22) | interface TimeProviderInterface
method getTime (line 27) | public function getTime(): Time;
FILE: src/Rfc4122/Fields.php
class Fields (line 40) | final class Fields implements FieldsInterface
method __construct (line 55) | public function __construct(private string $bytes)
method getBytes (line 79) | public function getBytes(): string
method getClockSeq (line 84) | public function getClockSeq(): Hexadecimal
method getClockSeqHiAndReserved (line 97) | public function getClockSeqHiAndReserved(): Hexadecimal
method getClockSeqLow (line 102) | public function getClockSeqLow(): Hexadecimal
method getNode (line 107) | public function getNode(): Hexadecimal
method getTimeHiAndVersion (line 112) | public function getTimeHiAndVersion(): Hexadecimal
method getTimeLow (line 117) | public function getTimeLow(): Hexadecimal
method getTimeMid (line 122) | public function getTimeMid(): Hexadecimal
method getTimestamp (line 139) | public function getTimestamp(): Hexadecimal
method getVersion (line 170) | public function getVersion(): ?int
method isCorrectVariant (line 182) | private function isCorrectVariant(): bool
FILE: src/Rfc4122/FieldsInterface.php
type FieldsInterface (line 41) | interface FieldsInterface extends BaseFieldsInterface
method getClockSeq (line 46) | public function getClockSeq(): Hexadecimal;
method getClockSeqHiAndReserved (line 51) | public function getClockSeqHiAndReserved(): Hexadecimal;
method getClockSeqLow (line 56) | public function getClockSeqLow(): Hexadecimal;
method getNode (line 61) | public function getNode(): Hexadecimal;
method getTimeHiAndVersion (line 66) | public function getTimeHiAndVersion(): Hexadecimal;
method getTimeLow (line 71) | public function getTimeLow(): Hexadecimal;
method getTimeMid (line 76) | public function getTimeMid(): Hexadecimal;
method getTimestamp (line 81) | public function getTimestamp(): Hexadecimal;
method getVariant (line 97) | public function getVariant(): int;
method getVersion (line 120) | public function getVersion(): ?int;
method isNil (line 129) | public function isNil(): bool;
FILE: src/Rfc4122/MaxTrait.php
type MaxTrait (line 22) | trait MaxTrait
method getBytes (line 29) | abstract public function getBytes(): string;
method isMax (line 36) | public function isMax(): bool
FILE: src/Rfc4122/MaxUuid.php
class MaxUuid (line 26) | final class MaxUuid extends Uuid implements UuidInterface
FILE: src/Rfc4122/NilTrait.php
type NilTrait (line 22) | trait NilTrait
method getBytes (line 29) | abstract public function getBytes(): string;
method isNil (line 34) | public function isNil(): bool
FILE: src/Rfc4122/NilUuid.php
class NilUuid (line 26) | final class NilUuid extends Uuid implements UuidInterface
FILE: src/Rfc4122/TimeTrait.php
type TimeTrait (line 31) | trait TimeTrait
method getDateTime (line 38) | public function getDateTime(): DateTimeInterface
FILE: src/Rfc4122/UuidBuilder.php
class UuidBuilder (line 35) | class UuidBuilder implements UuidBuilderInterface
method __construct (line 48) | public function __construct(
method build (line 66) | public function build(CodecInterface $codec, string $bytes): UuidInter...
method buildFields (line 117) | protected function buildFields(string $bytes): FieldsInterface
FILE: src/Rfc4122/UuidInterface.php
type UuidInterface (line 26) | interface UuidInterface extends BaseUuidInterface
FILE: src/Rfc4122/UuidV1.php
class UuidV1 (line 31) | final class UuidV1 extends Uuid implements UuidInterface
method __construct (line 44) | public function __construct(
FILE: src/Rfc4122/UuidV2.php
class UuidV2 (line 50) | final class UuidV2 extends Uuid implements UuidInterface
method __construct (line 63) | public function __construct(
method getLocalDomain (line 81) | public function getLocalDomain(): int
method getLocalDomainName (line 92) | public function getLocalDomainName(): string
method getLocalIdentifier (line 100) | public function getLocalIdentifier(): IntegerObject
FILE: src/Rfc4122/UuidV3.php
class UuidV3 (line 32) | final class UuidV3 extends Uuid implements UuidInterface
method __construct (line 43) | public function __construct(
FILE: src/Rfc4122/UuidV4.php
class UuidV4 (line 31) | final class UuidV4 extends Uuid implements UuidInterface
method __construct (line 42) | public function __construct(
FILE: src/Rfc4122/UuidV5.php
class UuidV5 (line 32) | final class UuidV5 extends Uuid implements UuidInterface
method __construct (line 43) | public function __construct(
FILE: src/Rfc4122/UuidV6.php
class UuidV6 (line 27) | final class UuidV6 extends NonstandardUuidV6 implements UuidInterface
FILE: src/Rfc4122/UuidV7.php
class UuidV7 (line 31) | final class UuidV7 extends Uuid implements UuidInterface
method __construct (line 44) | public function __construct(
FILE: src/Rfc4122/UuidV8.php
class UuidV8 (line 35) | final class UuidV8 extends Uuid implements UuidInterface
method __construct (line 46) | public function __construct(
FILE: src/Rfc4122/Validator.php
class Validator (line 28) | final class Validator implements ValidatorInterface
method getPattern (line 36) | public function getPattern(): string
method validate (line 41) | public function validate(string $uuid): bool
FILE: src/Rfc4122/VariantTrait.php
type VariantTrait (line 34) | trait VariantTrait
method getBytes (line 39) | abstract public function getBytes(): string;
method getVariant (line 55) | public function getVariant(): int
FILE: src/Rfc4122/VersionTrait.php
type VersionTrait (line 24) | trait VersionTrait
method getVersion (line 47) | abstract public function getVersion(): ?int;
method isMax (line 52) | abstract public function isMax(): bool;
method isNil (line 57) | abstract public function isNil(): bool;
method isCorrectVersion (line 64) | private function isCorrectVersion(): bool
FILE: src/Type/Decimal.php
class Decimal (line 34) | final class Decimal implements NumberInterface
method __construct (line 39) | public function __construct(float | int | string | self $value)
method isNegative (line 69) | public function isNegative(): bool
method toString (line 74) | public function toString(): string
method __toString (line 79) | public function __toString(): string
method jsonSerialize (line 84) | public function jsonSerialize(): string
method serialize (line 89) | public function serialize(): string
method __serialize (line 97) | public function __serialize(): array
method unserialize (line 107) | public function unserialize(string $data): void
method __unserialize (line 115) | public function __unserialize(array $data): void
FILE: src/Type/Hexadecimal.php
class Hexadecimal (line 32) | final class Hexadecimal implements TypeInterface
method __construct (line 42) | public function __construct(self | string $value)
method toString (line 52) | public function toString(): string
method __toString (line 60) | public function __toString(): string
method jsonSerialize (line 68) | public function jsonSerialize(): string
method serialize (line 76) | public function serialize(): string
method __serialize (line 84) | public function __serialize(): array
method unserialize (line 94) | public function unserialize(string $data): void
method __unserialize (line 102) | public function __unserialize(array $data): void
method prepareValue (line 116) | private function prepareValue(string $value): string
FILE: src/Type/Integer.php
class Integer (line 37) | final class Integer implements NumberInterface
method __construct (line 49) | public function __construct(self | float | int | string $value)
method isNegative (line 54) | public function isNegative(): bool
method toString (line 64) | public function toString(): string
method __toString (line 72) | public function __toString(): string
method jsonSerialize (line 77) | public function jsonSerialize(): string
method serialize (line 82) | public function serialize(): string
method __serialize (line 90) | public function __serialize(): array
method unserialize (line 100) | public function unserialize(string $data): void
method __unserialize (line 108) | public function __unserialize(array $data): void
method prepareValue (line 122) | private function prepareValue(float | int | string $value): string
FILE: src/Type/NumberInterface.php
type NumberInterface (line 22) | interface NumberInterface extends TypeInterface
method isNegative (line 27) | public function isNegative(): bool;
FILE: src/Type/Time.php
class Time (line 33) | final class Time implements TypeInterface
method __construct (line 38) | public function __construct(
method getSeconds (line 49) | public function getSeconds(): IntegerObject
method getMicroseconds (line 57) | public function getMicroseconds(): IntegerObject
method toString (line 62) | public function toString(): string
method __toString (line 67) | public function __toString(): string
method jsonSerialize (line 75) | public function jsonSerialize(): array
method serialize (line 83) | public function serialize(): string
method __serialize (line 91) | public function __serialize(): array
method unserialize (line 104) | public function unserialize(string $data): void
method __unserialize (line 119) | public function __unserialize(array $data): void
FILE: src/Type/TypeInterface.php
type TypeInterface (line 25) | interface TypeInterface extends JsonSerializable, Serializable
method toString (line 30) | public function toString(): string;
method __toString (line 35) | public function __toString(): string;
FILE: src/Uuid.php
class Uuid (line 47) | class Uuid implements UuidInterface
method __construct (line 270) | public function __construct(
method __toString (line 285) | public function __toString(): string
method jsonSerialize (line 293) | public function jsonSerialize(): string
method serialize (line 301) | public function serialize(): string
method __serialize (line 309) | public function __serialize(): array
method unserialize (line 319) | public function unserialize(string $data): void
method __unserialize (line 345) | public function __unserialize(array $data): void
method compareTo (line 356) | public function compareTo(UuidInterface $other): int
method equals (line 371) | public function equals(?object $other): bool
method getBytes (line 383) | public function getBytes(): string
method getFields (line 388) | public function getFields(): FieldsInterface
method getHex (line 393) | public function getHex(): Hexadecimal
method getInteger (line 398) | public function getInteger(): IntegerObject
method getUrn (line 403) | public function getUrn(): string
method toString (line 411) | public function toString(): string
method getFactory (line 419) | public static function getFactory(): UuidFactoryInterface
method setFactory (line 433) | public static function setFactory(UuidFactoryInterface $factory): void
method fromBytes (line 454) | public static function fromBytes(string $bytes): UuidInterface
method fromString (line 489) | public static function fromString(string $uuid): UuidInterface
method fromDateTime (line 515) | public static function fromDateTime(
method fromHexadecimal (line 534) | public static function fromHexadecimal(Hexadecimal $hex): UuidInterface
method fromInteger (line 562) | public static function fromInteger(string $integer): UuidInterface
method isValid (line 579) | public static function isValid(string $uuid): bool
method uuid1 (line 595) | public static function uuid1($node = null, ?int $clockSeq = null): Uui...
method uuid2 (line 614) | public static function uuid2(
method uuid3 (line 633) | public static function uuid3($ns, string $name): UuidInterface
method uuid4 (line 644) | public static function uuid4(): UuidInterface
method uuid5 (line 659) | public static function uuid5($ns, string $name): UuidInterface
method uuid6 (line 674) | public static function uuid6(
method uuid7 (line 689) | public static function uuid7(?DateTimeInterface $dateTime = null): Uui...
method uuid8 (line 715) | public static function uuid8(string $bytes): UuidInterface
FILE: src/UuidFactory.php
class UuidFactory (line 47) | class UuidFactory implements UuidFactoryInterface
method __construct (line 69) | public function __construct(?FeatureSet $features = null)
method getCodec (line 91) | public function getCodec(): CodecInterface
method setCodec (line 101) | public function setCodec(CodecInterface $codec): void
method getNameGenerator (line 111) | public function getNameGenerator(): NameGeneratorInterface
method setNameGenerator (line 121) | public function setNameGenerator(NameGeneratorInterface $nameGenerator...
method getNodeProvider (line 131) | public function getNodeProvider(): NodeProviderInterface
method getRandomGenerator (line 139) | public function getRandomGenerator(): RandomGeneratorInterface
method getTimeGenerator (line 147) | public function getTimeGenerator(): TimeGeneratorInterface
method setTimeGenerator (line 157) | public function setTimeGenerator(TimeGeneratorInterface $generator): void
method getDceSecurityGenerator (line 167) | public function getDceSecurityGenerator(): DceSecurityGeneratorInterface
method setDceSecurityGenerator (line 178) | public function setDceSecurityGenerator(DceSecurityGeneratorInterface ...
method getNumberConverter (line 188) | public function getNumberConverter(): NumberConverterInterface
method setRandomGenerator (line 198) | public function setRandomGenerator(RandomGeneratorInterface $generator...
method setNumberConverter (line 211) | public function setNumberConverter(NumberConverterInterface $converter...
method getUuidBuilder (line 221) | public function getUuidBuilder(): UuidBuilderInterface
method setUuidBuilder (line 231) | public function setUuidBuilder(UuidBuilderInterface $builder): void
method getValidator (line 238) | public function getValidator(): ValidatorInterface
method setValidator (line 248) | public function setValidator(ValidatorInterface $validator): void
method fromBytes (line 258) | public function fromBytes(string $bytes): UuidInterface
method fromString (line 266) | public function fromString(string $uuid): UuidInterface
method fromInteger (line 276) | public function fromInteger(string $integer): UuidInterface
method fromDateTime (line 284) | public function fromDateTime(
method fromHexadecimal (line 299) | public function fromHexadecimal(Hexadecimal $hex): UuidInterface
method uuid1 (line 307) | public function uuid1($node = null, ?int $clockSeq = null): UuidInterface
method uuid2 (line 314) | public function uuid2(
method uuid3 (line 329) | public function uuid3($ns, string $name): UuidInterface
method uuid4 (line 334) | public function uuid4(): UuidInterface
method uuid5 (line 345) | public function uuid5($ns, string $name): UuidInterface
method uuid6 (line 350) | public function uuid6(?Hexadecimal $node = null, ?int $clockSeq = null...
method uuid7 (line 375) | public function uuid7(?DateTimeInterface $dateTime = null): UuidInterface
method uuid8 (line 397) | public function uuid8(string $bytes): UuidInterface
method uuid (line 414) | public function uuid(string $bytes): UuidInterface
method uuidFromNsAndName (line 431) | private function uuidFromNsAndName(
method uuidFromBytesAndVersion (line 455) | private function uuidFromBytesAndVersion(string $bytes, int $version):...
FILE: src/UuidFactoryInterface.php
type UuidFactoryInterface (line 25) | interface UuidFactoryInterface
method fromBytes (line 36) | public function fromBytes(string $bytes): UuidInterface;
method fromDateTime (line 48) | public function fromDateTime(
method fromInteger (line 63) | public function fromInteger(string $integer): UuidInterface;
method fromString (line 74) | public function fromString(string $uuid): UuidInterface;
method getValidator (line 79) | public function getValidator(): ValidatorInterface;
method uuid1 (line 91) | public function uuid1($node = null, ?int $clockSeq = null): UuidInterf...
method uuid2 (line 107) | public function uuid2(
method uuid3 (line 124) | public function uuid3($ns, string $name): UuidInterface;
method uuid4 (line 131) | public function uuid4(): UuidInterface;
method uuid5 (line 143) | public function uuid5($ns, string $name): UuidInterface;
method uuid6 (line 154) | public function uuid6(?Hexadecimal $node = null, ?int $clockSeq = null...
FILE: src/UuidInterface.php
type UuidInterface (line 29) | interface UuidInterface extends
method compareTo (line 45) | public function compareTo(UuidInterface $other): int;
method equals (line 57) | public function equals(?object $other): bool;
method getBytes (line 66) | public function getBytes(): string;
method getFields (line 71) | public function getFields(): FieldsInterface;
method getHex (line 76) | public function getHex(): Hexadecimal;
method getInteger (line 81) | public function getInteger(): IntegerObject;
method getUrn (line 91) | public function getUrn(): string;
method toString (line 100) | public function toString(): string;
method __toString (line 109) | public function __toString(): string;
FILE: src/Validator/GenericValidator.php
class GenericValidator (line 27) | final class GenericValidator implements ValidatorInterface
method getPattern (line 37) | public function getPattern(): string
method validate (line 42) | public function validate(string $uuid): bool
FILE: src/Validator/ValidatorInterface.php
type ValidatorInterface (line 22) | interface ValidatorInterface
method getPattern (line 29) | public function getPattern(): string;
method validate (line 40) | public function validate(string $uuid): bool;
FILE: src/functions.php
function v1 (line 32) | function v1($node = null, ?int $clockSeq = null): string
function v2 (line 50) | function v2(
function v3 (line 68) | function v3($ns, string $name): string
function v4 (line 78) | function v4(): string
function v5 (line 92) | function v5($ns, string $name): string
function v6 (line 106) | function v6(?Hexadecimal $node = null, ?int $clockSeq = null): string
function v7 (line 119) | function v7(?DateTimeInterface $dateTime = null): string
function v8 (line 138) | function v8(string $bytes): string
FILE: tests/BinaryUtilsTest.php
class BinaryUtilsTest (line 11) | class BinaryUtilsTest extends TestCase
method testApplyVersion (line 16) | public function testApplyVersion(int $timeHi, int $version, int $expec...
method testApplyVariant (line 25) | public function testApplyVariant(int $clockSeq, int $expectedInt, stri...
method provideVersionTestValues (line 34) | public function provideVersionTestValues(): array
method provideVariantTestValues (line 133) | public function provideVariantTestValues(): array
FILE: tests/Builder/DefaultUuidBuilderTest.php
class DefaultUuidBuilderTest (line 18) | class DefaultUuidBuilderTest extends TestCase
method testBuildCreatesUuid (line 20) | public function testBuildCreatesUuid(): void
FILE: tests/Builder/FallbackBuilderTest.php
class FallbackBuilderTest (line 26) | class FallbackBuilderTest extends TestCase
method testBuildThrowsExceptionAfterAllConfiguredBuildersHaveErrored (line 28) | public function testBuildThrowsExceptionAfterAllConfiguredBuildersHave...
method testSerializationOfBuilderCollection (line 67) | public function testSerializationOfBuilderCollection(string $bytes): void
method provideBytes (line 123) | public function provideBytes(): array
FILE: tests/Codec/GuidStringCodecTest.php
class GuidStringCodecTest (line 22) | class GuidStringCodecTest extends TestCase
method setUp (line 39) | protected function setUp(): void
method tearDown (line 47) | protected function tearDown(): void
method testEncodeUsesFieldsArray (line 53) | public function testEncodeUsesFieldsArray(): void
method testEncodeReturnsFormattedString (line 62) | public function testEncodeReturnsFormattedString(): void
method testEncodeBinary (line 71) | public function testEncodeBinary(): void
method testDecodeReturnsGuid (line 87) | public function testDecodeReturnsGuid(): void
method testDecodeReturnsUuidFromBuilder (line 101) | public function testDecodeReturnsUuidFromBuilder(): void
method testDecodeBytesReturnsUuid (line 112) | public function testDecodeBytesReturnsUuid(): void
FILE: tests/Codec/OrderedTimeCodecTest.php
class OrderedTimeCodecTest (line 33) | class OrderedTimeCodecTest extends TestCase
method setUp (line 60) | protected function setUp(): void
method tearDown (line 68) | protected function tearDown(): void
method testEncodeUsesFieldsArray (line 74) | public function testEncodeUsesFieldsArray(): void
method testEncodeReturnsFormattedString (line 83) | public function testEncodeReturnsFormattedString(): void
method testEncodeBinary (line 92) | public function testEncodeBinary(): void
method testDecodeBytesThrowsExceptionWhenBytesStringNotSixteenCharacters (line 109) | public function testDecodeBytesThrowsExceptionWhenBytesStringNotSixtee...
method testDecodeReturnsUuidFromBuilder (line 120) | public function testDecodeReturnsUuidFromBuilder(): void
method testDecodeBytesRearrangesFields (line 130) | public function testDecodeBytesRearrangesFields(): void
method testEncodeBinaryThrowsExceptionForNonRfc4122Uuid (line 149) | public function testEncodeBinaryThrowsExceptionForNonRfc4122Uuid(): void
method testEncodeBinaryThrowsExceptionForNonTimeBasedUuid (line 171) | public function testEncodeBinaryThrowsExceptionForNonTimeBasedUuid(): ...
method testDecodeBytesThrowsExceptionsForNonRfc4122Uuid (line 191) | public function testDecodeBytesThrowsExceptionsForNonRfc4122Uuid(): void
method testDecodeBytesThrowsExceptionsForNonTimeBasedUuid (line 211) | public function testDecodeBytesThrowsExceptionsForNonTimeBasedUuid(): ...
method testSerializationDoesNotUseOrderedTimeCodec (line 232) | public function testSerializationDoesNotUseOrderedTimeCodec(): void
FILE: tests/Codec/StringCodecTest.php
class StringCodecTest (line 21) | class StringCodecTest extends TestCase
method setUp (line 43) | protected function setUp(): void
method tearDown (line 51) | protected function tearDown(): void
method testEncodeUsesFieldsArray (line 57) | public function testEncodeUsesFieldsArray(): void
method testEncodeReturnsFormattedString (line 66) | public function testEncodeReturnsFormattedString(): void
method testEncodeBinaryReturnsBinaryString (line 75) | public function testEncodeBinaryReturnsBinaryString(): void
method testDecodeUsesBuilderOnFields (line 90) | public function testDecodeUsesBuilderOnFields(): void
method testDecodeThrowsExceptionOnInvalidUuid (line 111) | public function testDecodeThrowsExceptionOnInvalidUuid(): void
method testDecodeReturnsUuidFromBuilder (line 120) | public function testDecodeReturnsUuidFromBuilder(): void
method testDecodeBytesThrowsExceptionWhenBytesStringNotSixteenCharacters (line 130) | public function testDecodeBytesThrowsExceptionWhenBytesStringNotSixtee...
method testDecodeBytesReturnsUuid (line 141) | public function testDecodeBytesReturnsUuid(): void
FILE: tests/Converter/Number/BigNumberConverterTest.php
class BigNumberConverterTest (line 11) | class BigNumberConverterTest extends TestCase
method testFromHexThrowsExceptionWhenStringDoesNotContainOnlyHexadecimalCharacters (line 13) | public function testFromHexThrowsExceptionWhenStringDoesNotContainOnly...
method testToHexThrowsExceptionWhenStringDoesNotContainOnlyDigits (line 23) | public function testToHexThrowsExceptionWhenStringDoesNotContainOnlyDi...
method testFromHex (line 36) | public function testFromHex(): void
method testToHex (line 43) | public function testToHex(): void
FILE: tests/Converter/Number/GenericNumberConverterTest.php
class GenericNumberConverterTest (line 11) | class GenericNumberConverterTest extends TestCase
method testFromHex (line 13) | public function testFromHex(): void
method testToHex (line 21) | public function testToHex(): void
FILE: tests/Converter/Time/BigNumberTimeConverterTest.php
class BigNumberTimeConverterTest (line 15) | class BigNumberTimeConverterTest extends TestCase
method testCalculateTimeReturnsArrayOfTimeSegments (line 17) | public function testCalculateTimeReturnsArrayOfTimeSegments(): void
method testConvertTime (line 41) | public function testConvertTime(): void
method testCalculateTimeThrowsExceptionWhenSecondsIsNotOnlyDigits (line 49) | public function testCalculateTimeThrowsExceptionWhenSecondsIsNotOnlyDi...
method testCalculateTimeThrowsExceptionWhenMicrosecondsIsNotOnlyDigits (line 62) | public function testCalculateTimeThrowsExceptionWhenMicrosecondsIsNotO...
FILE: tests/Converter/Time/GenericTimeConverterTest.php
class GenericTimeConverterTest (line 12) | class GenericTimeConverterTest extends TestCase
method testCalculateTime (line 21) | public function testCalculateTime(string $seconds, string $microsecond...
method provideCalculateTime (line 34) | public function provideCalculateTime(): array
method testConvertTime (line 92) | public function testConvertTime(Hexadecimal $uuidTimestamp, string $un...
method provideConvertTime (line 106) | public function provideConvertTime(): array
FILE: tests/Converter/Time/PhpTimeConverterTest.php
class PhpTimeConverterTest (line 18) | class PhpTimeConverterTest extends TestCase
method testCalculateTimeReturnsArrayOfTimeSegments (line 20) | public function testCalculateTimeReturnsArrayOfTimeSegments(): void
method testCalculateTimeThrowsExceptionWhenSecondsIsNotOnlyDigits (line 44) | public function testCalculateTimeThrowsExceptionWhenSecondsIsNotOnlyDi...
method testCalculateTimeThrowsExceptionWhenMicrosecondsIsNotOnlyDigits (line 58) | public function testCalculateTimeThrowsExceptionWhenMicrosecondsIsNotO...
method testConvertTime (line 78) | public function testConvertTime(Hexadecimal $uuidTimestamp, string $un...
method provideConvertTime (line 93) | public function provideConvertTime(): array
method testCalculateTime (line 146) | public function testCalculateTime(string $seconds, string $microsecond...
method provideCalculateTime (line 160) | public function provideCalculateTime(): array
FILE: tests/Converter/Time/UnixTimeConverterTest.php
class UnixTimeConverterTest (line 12) | class UnixTimeConverterTest extends TestCase
method testConvertTime (line 17) | public function testConvertTime(Hexadecimal $uuidTimestamp, string $un...
method provideConvertTime (line 31) | public function provideConvertTime(): array
method testCalculateTime (line 108) | public function testCalculateTime(string $seconds, string $microsecond...
method provideCalculateTime (line 121) | public function provideCalculateTime(): array
FILE: tests/DeprecatedUuidMethodsTraitTest.php
class DeprecatedUuidMethodsTraitTest (line 20) | class DeprecatedUuidMethodsTraitTest extends TestCase
method testGetDateTime (line 22) | public function testGetDateTime(): void
method testGetDateTimeThrowsException (line 37) | public function testGetDateTimeThrowsException(): void
FILE: tests/Encoder/TimestampFirstCombCodecTest.php
class TimestampFirstCombCodecTest (line 19) | class TimestampFirstCombCodecTest extends TestCase
method setUp (line 31) | protected function setUp(): void
method testEncoding (line 37) | public function testEncoding(): void
method testBinaryEncoding (line 50) | public function testBinaryEncoding(): void
method testDecoding (line 63) | public function testDecoding(): void
method testBinaryDecoding (line 81) | public function testBinaryDecoding(): void
FILE: tests/Encoder/TimestampLastCombCodecTest.php
class TimestampLastCombCodecTest (line 20) | class TimestampLastCombCodecTest extends TestCase
method setUp (line 32) | protected function setUp(): void
method testEncoding (line 38) | public function testEncoding(): void
method testBinaryEncoding (line 51) | public function testBinaryEncoding(): void
method testDecoding (line 66) | public function testDecoding(): void
method testBinaryDecoding (line 84) | public function testBinaryDecoding(): void
FILE: tests/ExpectedBehaviorTest.php
class ExpectedBehaviorTest (line 35) | class ExpectedBehaviorTest extends TestCase
method testStaticCreationMethodsAndStandardBehavior (line 40) | public function testStaticCreationMethodsAndStandardBehavior($method, ...
method provideStaticCreationMethods (line 126) | public function provideStaticCreationMethods()
method testUuidVersion1MethodBehavior (line 143) | public function testUuidVersion1MethodBehavior()
method testUuidVersion1MethodBehavior64Bit (line 153) | public function testUuidVersion1MethodBehavior64Bit()
method testIsValid (line 168) | public function testIsValid($uuid, $expected)
method provideIsValid (line 174) | public function provideIsValid()
method testSerialization (line 232) | public function testSerialization($string)
method testSerializationWithOrderedTimeCodec (line 247) | public function testSerializationWithOrderedTimeCodec($string)
method testNumericReturnValues (line 271) | public function testNumericReturnValues($string)
method testFromBytes (line 308) | public function testFromBytes($string, $version, $variant, $integer)
method testFromInteger (line 333) | public function testFromInteger($string, $version, $variant, $integer)
method testFromString (line 358) | public function testFromString($string, $version, $variant, $integer)
method provideFromStringInteger (line 380) | public function provideFromStringInteger()
method testGetSetFactory (line 424) | public function testGetSetFactory()
method testFactoryProvidesFunctionality (line 438) | public function testFactoryProvidesFunctionality()
method testUsingDegradedFeatures (line 467) | public function testUsingDegradedFeatures()
method testUsingCustomCodec (line 489) | public function testUsingCustomCodec()
method testUsingCustomRandomGenerator (line 517) | public function testUsingCustomRandomGenerator()
method testUsingCustomTimeGenerator (line 537) | public function testUsingCustomTimeGenerator()
method testUsingDefaultTimeGeneratorWithCustomProviders (line 557) | public function testUsingDefaultTimeGeneratorWithCustomProviders()
method testHelperFunctions (line 594) | public function testHelperFunctions()
method testUseOfTimestampFirstCombCodec (line 627) | public function testUseOfTimestampFirstCombCodec()
method testUuidConstants (line 662) | public function testUuidConstants($constantName, $expected)
method provideUuidConstantTests (line 667) | public function provideUuidConstantTests()
FILE: tests/FeatureSetTest.php
class FeatureSetTest (line 19) | class FeatureSetTest extends TestCase
method testGuidBuilderIsSelected (line 21) | public function testGuidBuilderIsSelected(): void
method testFallbackBuilderIsSelected (line 28) | public function testFallbackBuilderIsSelected(): void
method testSetValidatorSetsTheProvidedValidator (line 35) | public function testSetValidatorSetsTheProvidedValidator(): void
method testGetTimeConverter (line 45) | public function testGetTimeConverter(): void
method testDefaultNameGeneratorIsSelected (line 53) | public function testDefaultNameGeneratorIsSelected(): void
method testPeclUuidTimeGeneratorIsSelected (line 60) | public function testPeclUuidTimeGeneratorIsSelected(): void
method testGetCalculator (line 67) | public function testGetCalculator(): void
method testSetNodeProvider (line 74) | public function testSetNodeProvider(): void
method testGetUnixTimeGenerator (line 83) | public function testGetUnixTimeGenerator(): void
FILE: tests/FunctionsTest.php
class FunctionsTest (line 25) | class FunctionsTest extends TestCase
method testV1ReturnsVersion1UuidString (line 27) | public function testV1ReturnsVersion1UuidString(): void
method testV2ReturnsVersion2UuidString (line 35) | public function testV2ReturnsVersion2UuidString(): void
method testV3ReturnsVersion3UuidString (line 51) | public function testV3ReturnsVersion3UuidString(): void
method testV4ReturnsVersion4UuidString (line 60) | public function testV4ReturnsVersion4UuidString(): void
method testV5ReturnsVersion5UuidString (line 68) | public function testV5ReturnsVersion5UuidString(): void
method testV6ReturnsVersion6UuidString (line 77) | public function testV6ReturnsVersion6UuidString(): void
method testV7ReturnsVersion7UuidString (line 91) | public function testV7ReturnsVersion7UuidString(): void
method testV7WithCustomDateTimeReturnsVersion7UuidString (line 106) | public function testV7WithCustomDateTimeReturnsVersion7UuidString(): void
method testV8ReturnsVersion8UuidString (line 124) | public function testV8ReturnsVersion8UuidString(): void
FILE: tests/Generator/CombGeneratorTest.php
class CombGeneratorTest (line 21) | class CombGeneratorTest extends TestCase
method testGenerateUsesRandomGeneratorWithLengthMinusTimestampBytes (line 25) | public function testGenerateUsesRandomGeneratorWithLengthMinusTimestam...
method testGenerateCalculatesPaddedHexStringFromCurrentTimestamp (line 43) | public function testGenerateCalculatesPaddedHexStringFromCurrentTimest...
method testGenerateReturnsBinaryStringCreatedFromGeneratorAndConverter (line 58) | public function testGenerateReturnsBinaryStringCreatedFromGeneratorAnd...
method lengthLessThanSix (line 88) | public function lengthLessThanSix(): array
method testGenerateWithLessThanTimestampBytesThrowsException (line 98) | public function testGenerateWithLessThanTimestampBytesThrowsException(...
method testGenerateWithOddNumberOverTimestampBytesCausesError (line 112) | public function testGenerateWithOddNumberOverTimestampBytesCausesError...
FILE: tests/Generator/DceSecurityGeneratorTest.php
class DceSecurityGeneratorTest (line 28) | class DceSecurityGeneratorTest extends TestCase
method testGenerateBytesReplacesBytesWithDceValues (line 38) | public function testGenerateBytesReplacesBytesWithDceValues(
method provideValuesForDceSecurityGenerator (line 83) | public function provideValuesForDceSecurityGenerator(): array
method testGenerateThrowsExceptionForInvalidDomain (line 131) | public function testGenerateThrowsExceptionForInvalidDomain(): void
method testGenerateThrowsExceptionForOrgWithoutIdentifier (line 145) | public function testGenerateThrowsExceptionForOrgWithoutIdentifier(): ...
method testClockSequenceLowerBounds (line 159) | public function testClockSequenceLowerBounds(): void
method testClockSequenceUpperBounds (line 188) | public function testClockSequenceUpperBounds(): void
method testExceptionThrownWhenClockSequenceTooLow (line 217) | public function testExceptionThrownWhenClockSequenceTooLow(): void
method testExceptionThrownWhenClockSequenceTooHigh (line 233) | public function testExceptionThrownWhenClockSequenceTooHigh(): void
method testExceptionThrownWhenLocalIdTooLow (line 249) | public function testExceptionThrownWhenLocalIdTooLow(): void
method testExceptionThrownWhenLocalIdTooHigh (line 265) | public function testExceptionThrownWhenLocalIdTooHigh(): void
FILE: tests/Generator/DefaultNameGeneratorTest.php
class DefaultNameGeneratorTest (line 14) | class DefaultNameGeneratorTest extends TestCase
method testDefaultNameGeneratorHashesName (line 23) | public function testDefaultNameGeneratorHashesName(string $ns, string ...
method provideNamesForHashingTest (line 36) | public function provideNamesForHashingTest(): array
method testGenerateThrowsException (line 72) | public function testGenerateThrowsException(): void
FILE: tests/Generator/DefaultTimeGeneratorTest.php
class DefaultTimeGeneratorTest (line 27) | class DefaultTimeGeneratorTest extends TestCase
method setUp (line 64) | protected function setUp(): void
method tearDown (line 78) | protected function tearDown(): void
method testGenerateUsesNodeProviderWhenNodeIsNull (line 85) | public function testGenerateUsesNodeProviderWhenNodeIsNull(): void
method testGenerateUsesTimeProvidersCurrentTime (line 102) | public function testGenerateUsesTimeProvidersCurrentTime(): void
method testGenerateCalculatesTimeWithConverter (line 116) | public function testGenerateCalculatesTimeWithConverter(): void
method testGenerateDoesNotApplyVersionAndVariant (line 134) | public function testGenerateDoesNotApplyVersionAndVariant(): void
method testGenerateUsesRandomSequenceWhenClockSeqNull (line 159) | public function testGenerateUsesRandomSequenceWhenClockSeqNull(): void
method testGenerateThrowsExceptionWhenExceptionThrownByRandomint (line 181) | public function testGenerateThrowsExceptionWhenExceptionThrownByRandom...
method testDefaultTimeGeneratorThrowsExceptionForLargeGeneratedValue (line 199) | public function testDefaultTimeGeneratorThrowsExceptionForLargeGenerat...
FILE: tests/Generator/NameGeneratorFactoryTest.php
class NameGeneratorFactoryTest (line 11) | class NameGeneratorFactoryTest extends TestCase
method testGetGenerator (line 13) | public function testGetGenerator(): void
FILE: tests/Generator/PeclUuidNameGeneratorTest.php
class PeclUuidNameGeneratorTest (line 19) | class PeclUuidNameGeneratorTest extends TestCase
method testPeclUuidNameGeneratorHashesName (line 27) | public function testPeclUuidNameGeneratorHashesName(string $ns, string...
method provideNamesForHashingTest (line 61) | public function provideNamesForHashingTest(): array
method testGenerateThrowsException (line 92) | public function testGenerateThrowsException(): void
FILE: tests/Generator/PeclUuidRandomGeneratorTest.php
class PeclUuidRandomGeneratorTest (line 12) | class PeclUuidRandomGeneratorTest extends TestCase
method testGenerateCreatesUuidUsingPeclUuidMethods (line 17) | public function testGenerateCreatesUuidUsingPeclUuidMethods(): void
FILE: tests/Generator/PeclUuidTimeGeneratorTest.php
class PeclUuidTimeGeneratorTest (line 12) | class PeclUuidTimeGeneratorTest extends TestCase
method testGenerateCreatesUuidUsingPeclUuidMethods (line 17) | public function testGenerateCreatesUuidUsingPeclUuidMethods(): void
FILE: tests/Generator/RandomBytesGeneratorTest.php
class RandomBytesGeneratorTest (line 15) | class RandomBytesGeneratorTest extends TestCase
method lengthAndHexDataProvider (line 20) | public function lengthAndHexDataProvider(): array
method testGenerateReturnsRandomBytes (line 39) | public function testGenerateReturnsRandomBytes(int $length, string $he...
method testGenerateThrowsExceptionWhenExceptionThrownByRandomBytes (line 57) | public function testGenerateThrowsExceptionWhenExceptionThrownByRandom...
FILE: tests/Generator/RandomGeneratorFactoryTest.php
class RandomGeneratorFactoryTest (line 11) | class RandomGeneratorFactoryTest extends TestCase
method testFactoryReturnsRandomBytesGenerator (line 13) | public function testFactoryReturnsRandomBytesGenerator(): void
FILE: tests/Generator/RandomLibAdapterTest.php
class RandomLibAdapterTest (line 14) | class RandomLibAdapterTest extends TestCase
method testAdapterWithGeneratorDoesNotCreateGenerator (line 20) | public function testAdapterWithGeneratorDoesNotCreateGenerator(): void
method testAdapterWithoutGeneratorCreatesGenerator (line 37) | public function testAdapterWithoutGeneratorCreatesGenerator(): void
method testGenerateUsesGenerator (line 49) | public function testGenerateUsesGenerator(): void
method testGenerateReturnsString (line 64) | public function testGenerateReturnsString(): void
FILE: tests/Generator/TimeGeneratorFactoryTest.php
class TimeGeneratorFactoryTest (line 15) | class TimeGeneratorFactoryTest extends TestCase
method testGeneratorReturnsNewGenerator (line 17) | public function testGeneratorReturnsNewGenerator(): void
FILE: tests/Generator/UnixTimeGeneratorTest.php
class UnixTimeGeneratorTest (line 15) | class UnixTimeGeneratorTest extends TestCase
method testGenerate (line 23) | public function testGenerate(): void
method testGenerateProducesMonotonicResults (line 49) | public function testGenerateProducesMonotonicResults(): void
method testGenerateProducesMonotonicResultsWithSameDate (line 69) | public function testGenerateProducesMonotonicResultsWithSameDate(): void
method testGenerateProducesMonotonicResultsFor32BitPath (line 90) | public function testGenerateProducesMonotonicResultsFor32BitPath(): void
method testGenerateProducesMonotonicResultsWithSameDateFor32BitPath (line 110) | public function testGenerateProducesMonotonicResultsWithSameDateFor32B...
method testGenerateProducesMonotonicResultsStartingWithAllBitsSet (line 131) | public function testGenerateProducesMonotonicResultsStartingWithAllBit...
method testGenerateRollsOverWithAllBitsSetWithSameDate (line 159) | public function testGenerateRollsOverWithAllBitsSetWithSameDate(): void
method testGenerateProducesMonotonicResultsStartingWithAllBitsSetFor32BitPath (line 187) | public function testGenerateProducesMonotonicResultsStartingWithAllBit...
method testGenerateRollsOverWithAllBitsSetWithSameDateFor32BitPath (line 215) | public function testGenerateRollsOverWithAllBitsSetWithSameDateFor32Bi...
FILE: tests/Guid/FieldsTest.php
class FieldsTest (line 16) | class FieldsTest extends TestCase
method testConstructorThrowsExceptionIfNotSixteenByteString (line 18) | public function testConstructorThrowsExceptionIfNotSixteenByteString()...
method testConstructorThrowsExceptionIfNotRfc4122Variant (line 33) | public function testConstructorThrowsExceptionIfNotRfc4122Variant(stri...
method nonRfc4122GuidVariantProvider (line 51) | public function nonRfc4122GuidVariantProvider(): array
method testConstructorThrowsExceptionIfInvalidVersion (line 74) | public function testConstructorThrowsExceptionIfInvalidVersion(string ...
method invalidVersionProvider (line 89) | public function invalidVersionProvider(): array
method testFieldGetterMethods (line 113) | public function testFieldGetterMethods(
method fieldGetterMethodProvider (line 133) | public function fieldGetterMethodProvider(): array
method testSerializingFields (line 225) | public function testSerializingFields(): void
FILE: tests/Guid/GuidBuilderTest.php
class GuidBuilderTest (line 14) | class GuidBuilderTest extends TestCase
method testBuildThrowsException (line 16) | public function testBuildThrowsException(): void
FILE: tests/Math/BrickMathCalculatorTest.php
class BrickMathCalculatorTest (line 13) | class BrickMathCalculatorTest extends TestCase
method testAdd (line 15) | public function testAdd(): void
method testSubtract (line 28) | public function testSubtract(): void
method testMultiply (line 41) | public function testMultiply(): void
method testDivide (line 54) | public function testDivide(): void
method testFromBase (line 67) | public function testFromBase(): void
method testToBase (line 76) | public function testToBase(): void
method testToHexadecimal (line 84) | public function testToHexadecimal(): void
method testFromBaseThrowsException (line 94) | public function testFromBaseThrowsException(): void
method testToBaseThrowsException (line 104) | public function testToBaseThrowsException(): void
FILE: tests/Nonstandard/FieldsTest.php
class FieldsTest (line 18) | class FieldsTest extends TestCase
method testConstructorThrowsExceptionIfNotSixteenByteString (line 20) | public function testConstructorThrowsExceptionIfNotSixteenByteString()...
method testFieldGetterMethods (line 37) | public function testFieldGetterMethods(
method fieldGetterMethodProvider (line 57) | public function fieldGetterMethodProvider(): array
method testSerializingFields (line 75) | public function testSerializingFields(): void
FILE: tests/Nonstandard/UuidBuilderTest.php
class UuidBuilderTest (line 14) | class UuidBuilderTest extends TestCase
method testBuildThrowsException (line 16) | public function testBuildThrowsException(): void
FILE: tests/Nonstandard/UuidV6Test.php
class UuidV6Test (line 22) | class UuidV6Test extends TestCase
method testConstructorThrowsExceptionWhenFieldsAreNotValidForType (line 27) | public function testConstructorThrowsExceptionWhenFieldsAreNotValidFor...
method provideTestVersions (line 49) | public function provideTestVersions(): array
method testGetDateTimeProperlyHandlesLongMicroseconds (line 69) | public function testGetDateTimeProperlyHandlesLongMicroseconds(string ...
method provideUuidV6WithOddMicroseconds (line 83) | public function provideUuidV6WithOddMicroseconds(): array
method testToUuidV1 (line 111) | public function testToUuidV1(string $uuidv6, string $uuidv1): void
method testFromUuidV1 (line 132) | public function testFromUuidV1(string $uuidv6, string $uuidv1): void
method provideUuidV1UuidV6Equivalents (line 151) | public function provideUuidV1UuidV6Equivalents(): array
method testGetDateTimeThrowsException (line 173) | public function testGetDateTimeThrowsException(): void
FILE: tests/Provider/Dce/SystemDceSecurityProviderTest.php
class SystemDceSecurityProviderTest (line 15) | class SystemDceSecurityProviderTest extends TestCase
method testGetUidThrowsExceptionIfShellExecDisabled (line 21) | public function testGetUidThrowsExceptionIfShellExecDisabled(): void
method testGetUidForPosixThrowsExceptionIfShellExecReturnsNull (line 56) | public function testGetUidForPosixThrowsExceptionIfShellExecReturnsNul...
method testGetUidForWindowsThrowsExceptionIfShellExecForWhoAmIReturnsBadValues (line 92) | public function testGetUidForWindowsThrowsExceptionIfShellExecForWhoAm...
method testGetUidForWindowsWhenShellExecForWhoAmIReturnsGoodValues (line 126) | public function testGetUidForWindowsWhenShellExecForWhoAmIReturnsGoodV...
method provideWindowsGoodWhoAmIValues (line 156) | public function provideWindowsGoodWhoAmIValues(): array
method testGetUidForPosixSystems (line 179) | public function testGetUidForPosixSystems(string $os, string $id): void
method testGetGidThrowsExceptionIfShellExecDisabled (line 208) | public function testGetGidThrowsExceptionIfShellExecDisabled(): void
method testGetGidForPosixThrowsExceptionIfShellExecReturnsNull (line 243) | public function testGetGidForPosixThrowsExceptionIfShellExecReturnsNul...
method testGetGidForPosixSystems (line 277) | public function testGetGidForPosixSystems(string $os, string $id): void
method testGetGidForWindowsThrowsExceptionWhenShellExecForNetUserReturnsBadValues (line 309) | public function testGetGidForWindowsThrowsExceptionWhenShellExecForNet...
method testGetGidForWindowsThrowsExceptionWhenShellExecForWmicGroupGetReturnsBadValues (line 345) | public function testGetGidForWindowsThrowsExceptionWhenShellExecForWmi...
method testGetGidForWindowsSucceeds (line 386) | public function testGetGidForWindowsSucceeds(
method provideWindowsGoodNetUserAndWmicGroupValues (line 430) | public function provideWindowsGoodNetUserAndWmicGroupValues(): array
method providePosixTestValues (line 463) | public function providePosixTestValues(): array
method provideWindowsBadValues (line 479) | public function provideWindowsBadValues(): array
method provideWindowsBadGroupValues (line 495) | public function provideWindowsBadGroupValues(): array
FILE: tests/Provider/Node/FallbackNodeProviderTest.php
class FallbackNodeProviderTest (line 16) | class FallbackNodeProviderTest extends TestCase
method testGetNodeCallsGetNodeOnEachProviderUntilNodeFound (line 18) | public function testGetNodeCallsGetNodeOnEachProviderUntilNodeFound():...
method testGetNodeReturnsNodeFromFirstProviderWithNode (line 33) | public function testGetNodeReturnsNodeFromFirstProviderWithNode(): void
method testGetNodeThrowsExceptionWhenNoNodesFound (line 53) | public function testGetNodeThrowsExceptionWhenNoNodesFound(): void
method testSerializationOfNodeProviderCollection (line 69) | public function testSerializationOfNodeProviderCollection(): void
FILE: tests/Provider/Node/RandomNodeProviderTest.php
class RandomNodeProviderTest (line 19) | class RandomNodeProviderTest extends TestCase
method testGetNodeUsesRandomBytes (line 25) | public function testGetNodeUsesRandomBytes(): void
method testGetNodeAlreadyHasMulticastBit (line 45) | public function testGetNodeAlreadyHasMulticastBit(): void
method testGetNodeSetsMulticastBitForLowNodeValue (line 67) | public function testGetNodeSetsMulticastBitForLowNodeValue(): void
method testGetNodeAlwaysSetsMulticastBit (line 82) | public function testGetNodeAlwaysSetsMulticastBit(): void
method testGetNodeThrowsExceptionWhenExceptionThrownByRandombytes (line 111) | public function testGetNodeThrowsExceptionWhenExceptionThrownByRandomb...
FILE: tests/Provider/Node/StaticNodeProviderTest.php
class StaticNodeProviderTest (line 12) | class StaticNodeProviderTest extends TestCase
method testStaticNode (line 19) | public function testStaticNode(Hexadecimal $node, string $expectedNode...
method provideNodeForTest (line 29) | public function provideNodeForTest(): array
method testStaticNodeThrowsExceptionForTooLongNode (line 51) | public function testStaticNodeThrowsExceptionForTooLongNode(): void
FILE: tests/Provider/Node/SystemNodeProviderTest.php
class SystemNodeProviderTest (line 47) | class SystemNodeProviderTest extends TestCase
method testGetNodeReturnsSystemNodeFromMacAddress (line 68) | public function testGetNodeReturnsSystemNodeFromMacAddress(string $net...
method testGetNodeShouldNotReturnsSystemNodeForInvalidMacAddress (line 102) | public function testGetNodeShouldNotReturnsSystemNodeForInvalidMacAddr...
method testGetNodeReturnsNodeStrippedOfNotationalFormatting (line 135) | public function testGetNodeReturnsNodeStrippedOfNotationalFormatting(s...
method testGetNodeDoesNotAcceptIncorrectNotationalFormatting (line 163) | public function testGetNodeDoesNotAcceptIncorrectNotationalFormatting(...
method testGetNodeReturnsFirstMacAddressFound (line 195) | public function testGetNodeReturnsFirstMacAddressFound(): void
method testGetNodeReturnsFalseWhenNodeIsNotFound (line 222) | public function testGetNodeReturnsFalseWhenNodeIsNotFound(): void
method testGetNodeWillNotExecuteSystemCallIfFailedFirstTime (line 254) | public function testGetNodeWillNotExecuteSystemCallIfFailedFirstTime()...
method testGetNodeGetsNetworkInterfaceConfig (line 295) | public function testGetNodeGetsNetworkInterfaceConfig(string $os, stri...
method testGetNodeReturnsSameNodeUponSubsequentCalls (line 342) | public function testGetNodeReturnsSameNodeUponSubsequentCalls(): void
method testSubsequentCallsToGetNodeDoNotRecallIfconfig (line 370) | public function testSubsequentCallsToGetNodeDoNotRecallIfconfig(): void
method testCallGetsysfsOnLinux (line 399) | public function testCallGetsysfsOnLinux(string $os, string $command): ...
method testCallGetsysfsOnLinuxWhenGlobReturnsFalse (line 454) | public function testCallGetsysfsOnLinuxWhenGlobReturnsFalse(): void
method testCallGetsysfsOnLinuxWhenGlobReturnsEmptyArray (line 487) | public function testCallGetsysfsOnLinuxWhenGlobReturnsEmptyArray(): void
method testCallGetsysfsOnLinuxWhenGlobFilesAreNotReadable (line 520) | public function testCallGetsysfsOnLinuxWhenGlobFilesAreNotReadable(): ...
method testGetNodeReturnsFalseWhenPassthruIsDisabled (line 555) | public function testGetNodeReturnsFalseWhenPassthruIsDisabled(): void
method arrangeMockFunctions (line 598) | private function arrangeMockFunctions(
method assertMockFunctions (line 641) | private function assertMockFunctions(
method provideCommandPerOs (line 692) | public function provideCommandPerOs(): array
method provideInvalidNetStatOutput (line 709) | public function provideInvalidNetStatOutput(): array
method provideInvalidNotationalFormats (line 735) | public function provideInvalidNotationalFormats(): array
method provideNotationalFormats (line 755) | public function provideNotationalFormats(): array
method provideValidNetStatOutput (line 768) | public function provideValidNetStatOutput(): array
FILE: tests/Provider/Time/FixedTimeProviderTest.php
class FixedTimeProviderTest (line 11) | class FixedTimeProviderTest extends TestCase
method testGetTimeReturnsTime (line 13) | public function testGetTimeReturnsTime(): void
method testGetTimeReturnsTimeAfterChange (line 21) | public function testGetTimeReturnsTimeAfterChange(): void
FILE: tests/Provider/Time/SystemTimeProviderTest.php
class SystemTimeProviderTest (line 11) | class SystemTimeProviderTest extends TestCase
method testGetTimeUses (line 13) | public function testGetTimeUses(): void
FILE: tests/Rfc4122/FieldsTest.php
class FieldsTest (line 17) | class FieldsTest extends TestCase
method testConstructorThrowsExceptionIfNotSixteenByteString (line 19) | public function testConstructorThrowsExceptionIfNotSixteenByteString()...
method testConstructorThrowsExceptionIfNotRfc4122Variant (line 34) | public function testConstructorThrowsExceptionIfNotRfc4122Variant(stri...
method nonRfc4122VariantProvider (line 49) | public function nonRfc4122VariantProvider(): array
method testConstructorThrowsExceptionIfInvalidVersion (line 72) | public function testConstructorThrowsExceptionIfInvalidVersion(string ...
method invalidVersionProvider (line 87) | public function invalidVersionProvider(): array
method testFieldGetterMethods (line 108) | public function testFieldGetterMethods(
method fieldGetterMethodProvider (line 128) | public function fieldGetterMethodProvider(): array
method testSerializingFields (line 250) | public function testSerializingFields(): void
method testSerializingFieldsWithOldFormat (line 263) | public function testSerializingFieldsWithOldFormat(): void
FILE: tests/Rfc4122/UuidBuilderTest.php
class UuidBuilderTest (line 32) | class UuidBuilderTest extends TestCase
method testBuild (line 40) | public function testBuild(string $uuid, string $expectedClass, ?int $e...
method provideBuildTestValues (line 62) | public function provideBuildTestValues(): array
method testBuildThrowsUnableToBuildException (line 128) | public function testBuildThrowsUnableToBuildException(): void
method testBuildThrowsUnableToBuildExceptionForIncorrectVersionFields (line 146) | public function testBuildThrowsUnableToBuildExceptionForIncorrectVersi...
FILE: tests/Rfc4122/UuidV1Test.php
class UuidV1Test (line 21) | class UuidV1Test extends TestCase
method testConstructorThrowsExceptionWhenFieldsAreNotValidForType (line 26) | public function testConstructorThrowsExceptionWhenFieldsAreNotValidFor...
method provideTestVersions (line 48) | public function provideTestVersions(): array
method testGetDateTimeProperlyHandlesLongMicroseconds (line 69) | public function testGetDateTimeProperlyHandlesLongMicroseconds(string ...
method provideUuidV1WithOddMicroseconds (line 83) | public function provideUuidV1WithOddMicroseconds(): array
method testGetDateTimeThrowsException (line 105) | public function testGetDateTimeThrowsException(): void
FILE: tests/Rfc4122/UuidV2Test.php
class UuidV2Test (line 32) | class UuidV2Test extends TestCase
method testConstructorThrowsExceptionWhenFieldsAreNotValidForType (line 37) | public function testConstructorThrowsExceptionWhenFieldsAreNotValidFor...
method provideTestVersions (line 59) | public function provideTestVersions(): array
method testGetLocalDomainAndIdentifier (line 77) | public function testGetLocalDomainAndIdentifier(
method provideLocalDomainAndIdentifierForTests (line 128) | public function provideLocalDomainAndIdentifierForTests(): array
FILE: tests/Rfc4122/UuidV3Test.php
class UuidV3Test (line 16) | class UuidV3Test extends TestCase
method testConstructorThrowsExceptionWhenFieldsAreNotValidForType (line 21) | public function testConstructorThrowsExceptionWhenFieldsAreNotValidFor...
method provideTestVersions (line 43) | public function provideTestVersions(): array
FILE: tests/Rfc4122/UuidV4Test.php
class UuidV4Test (line 16) | class UuidV4Test extends TestCase
method testConstructorThrowsExceptionWhenFieldsAreNotValidForType (line 21) | public function testConstructorThrowsExceptionWhenFieldsAreNotValidFor...
method provideTestVersions (line 43) | public function provideTestVersions(): array
FILE: tests/Rfc4122/UuidV5Test.php
class UuidV5Test (line 16) | class UuidV5Test extends TestCase
method testConstructorThrowsExceptionWhenFieldsAreNotValidForType (line 21) | public function testConstructorThrowsExceptionWhenFieldsAreNotValidFor...
method provideTestVersions (line 43) | public function provideTestVersions(): array
FILE: tests/Rfc4122/UuidV6Test.php
class UuidV6Test (line 22) | class UuidV6Test extends TestCase
method testConstructorThrowsExceptionWhenFieldsAreNotValidForType (line 27) | public function testConstructorThrowsExceptionWhenFieldsAreNotValidFor...
method provideTestVersions (line 49) | public function provideTestVersions(): array
method testGetDateTimeProperlyHandlesLongMicroseconds (line 70) | public function testGetDateTimeProperlyHandlesLongMicroseconds(string ...
method provideUuidV6WithOddMicroseconds (line 84) | public function provideUuidV6WithOddMicroseconds(): array
method testToUuidV1 (line 112) | public function testToUuidV1(string $uuidv6, string $uuidv1): void
method testFromUuidV1 (line 133) | public function testFromUuidV1(string $uuidv6, string $uuidv1): void
method provideUuidV1UuidV6Equivalents (line 152) | public function provideUuidV1UuidV6Equivalents(): array
method testGetDateTimeThrowsException (line 174) | public function testGetDateTimeThrowsException(): void
method testUsingDraftPeabodyUuidV6TestVector (line 198) | public function testUsingDraftPeabodyUuidV6TestVector(): void
FILE: tests/Rfc4122/UuidV7Test.php
class UuidV7Test (line 21) | class UuidV7Test extends TestCase
method testConstructorThrowsExceptionWhenFieldsAreNotValidForType (line 26) | public function testConstructorThrowsExceptionWhenFieldsAreNotValidFor...
method provideTestVersions (line 48) | public function provideTestVersions(): array
method testGetDateTimeProperlyHandlesMicroseconds (line 68) | public function testGetDateTimeProperlyHandlesMicroseconds(string $uui...
method provideUuidV7WithMicroseconds (line 82) | public function provideUuidV7WithMicroseconds(): array
method testGetDateTimeThrowsException (line 112) | public function testGetDateTimeThrowsException(): void
FILE: tests/Rfc4122/UuidV8Test.php
class UuidV8Test (line 16) | class UuidV8Test extends TestCase
method testConstructorThrowsExceptionWhenFieldsAreNotValidForType (line 21) | public function testConstructorThrowsExceptionWhenFieldsAreNotValidFor...
method provideTestVersions (line 40) | public function provideTestVersions(): array
FILE: tests/Rfc4122/ValidatorTest.php
class ValidatorTest (line 14) | class ValidatorTest extends TestCase
method testValidate (line 19) | public function testValidate(string $value, bool $expected): void
method provideValuesForValidation (line 48) | public function provideValuesForValidation(): array
method testGetPattern (line 113) | public function testGetPattern(): void
FILE: tests/Rfc4122/VariantTraitTest.php
class VariantTraitTest (line 16) | class VariantTraitTest extends TestCase
method testGetVariantThrowsExceptionForWrongNumberOfBytes (line 21) | public function testGetVariantThrowsExceptionForWrongNumberOfBytes(str...
method invalidBytesProvider (line 39) | public function invalidBytesProvider(): array
method testGetVariant (line 50) | public function testGetVariant(string $uuid, int $expectedVariant): void
method uuidVariantProvider (line 67) | public function uuidVariantProvider(): array
FILE: tests/TestCase.php
class TestCase (line 14) | class TestCase extends PhpUnitTestCase
method tearDown (line 16) | protected function tearDown(): void
method isLittleEndianSystem (line 22) | public static function isLittleEndianSystem(): bool
FILE: tests/Type/DecimalTest.php
class DecimalTest (line 16) | class DecimalTest extends TestCase
method testDecimalValueType (line 23) | public function testDecimalValueType($value, string $expected, bool $e...
method provideDecimal (line 35) | public function provideDecimal(): array
method testDecimalTypeThrowsExceptionForBadValues (line 251) | public function testDecimalTypeThrowsExceptionForBadValues($value): void
method provideDecimalBadValues (line 265) | public function provideDecimalBadValues(): array
method testSerializeUnserializeDecimal (line 282) | public function testSerializeUnserializeDecimal($value, string $expect...
method testJsonSerialize (line 298) | public function testJsonSerialize($value, string $expected): void
FILE: tests/Type/HexadecimalTest.php
class HexadecimalTest (line 16) | class HexadecimalTest extends TestCase
method testHexadecimalType (line 21) | public function testHexadecimalType(string $value, string $expected): ...
method provideHex (line 32) | public function provideHex(): array
method testHexadecimalTypeThrowsExceptionForBadValues (line 53) | public function testHexadecimalTypeThrowsExceptionForBadValues(string ...
method provideHexBadValues (line 66) | public function provideHexBadValues(): array
method testSerializeUnserializeHexadecimal (line 79) | public function testSerializeUnserializeHexadecimal(string $value, str...
method testJsonSerialize (line 93) | public function testJsonSerialize(string $value, string $expected): void
FILE: tests/Type/IntegerTest.php
class IntegerTest (line 16) | class IntegerTest extends TestCase
method testIntegerType (line 23) | public function testIntegerType($value, string $expected, bool $expect...
method provideInteger (line 35) | public function provideInteger(): array
method testIntegerTypeThrowsExceptionForBadValues (line 166) | public function testIntegerTypeThrowsExceptionForBadValues($value): void
method provideIntegerBadValues (line 180) | public function provideIntegerBadValues(): array
method testSerializeUnserializeInteger (line 202) | public function testSerializeUnserializeInteger($value, string $expect...
method testJsonSerialize (line 218) | public function testJsonSerialize($value, string $expected): void
FILE: tests/Type/TimeTest.php
class TimeTest (line 16) | class TimeTest extends TestCase
method testTime (line 24) | public function testTime($seconds, $microseconds): void
method provideTimeValues (line 51) | public function provideTimeValues(): array
method testSerializeUnserializeTime (line 71) | public function testSerializeUnserializeTime($seconds, $microseconds):...
method testUnserializeOfInvalidValueException (line 92) | public function testUnserializeOfInvalidValueException(): void
method testJsonSerialize (line 108) | public function testJsonSerialize($seconds, $microseconds): void
FILE: tests/UuidFactoryTest.php
class UuidFactoryTest (line 30) | class UuidFactoryTest extends TestCase
method testParsesUuidCorrectly (line 32) | public function testParsesUuidCorrectly(): void
method testParsesGuidCorrectly (line 42) | public function testParsesGuidCorrectly(): void
method testFromStringParsesUuidInLowercase (line 52) | public function testFromStringParsesUuidInLowercase(): void
method testGettersReturnValueFromFeatureSet (line 63) | public function testGettersReturnValueFromFeatureSet(): void
method testSettersSetValueForGetters (line 117) | public function testSettersSetValueForGetters(): void
method testFromDateTime (line 145) | public function testFromDateTime(
method provideDateTime (line 163) | public function provideDateTime(): array
method testFactoryReturnsDefaultNameGenerator (line 211) | public function testFactoryReturnsDefaultNameGenerator(): void
method testFactoryReturnsSetNameGenerator (line 218) | public function testFactoryReturnsSetNameGenerator(): void
FILE: tests/UuidTest.php
class UuidTest (line 62) | class UuidTest extends TestCase
method setUp (line 64) | protected function setUp(): void
method testFromString (line 69) | public function testFromString(): void
method testFromHexadecimal (line 78) | public function testFromHexadecimal(): void
method testFromHexadecimalShort (line 86) | public function testFromHexadecimalShort(): void
method testFromHexadecimalThrowsWhenMethodDoesNotExist (line 96) | public function testFromHexadecimalThrowsWhenMethodDoesNotExist(): void
method testFromGuidString (line 113) | public function testFromGuidString(): void
method testFromStringWithCurlyBraces (line 128) | public function testFromStringWithCurlyBraces(): void
method testFromStringWithInvalidUuidString (line 134) | public function testFromStringWithInvalidUuidString(): void
method testFromStringWithLeadingNewLine (line 142) | public function testFromStringWithLeadingNewLine(): void
method testFromStringWithTrailingNewLine (line 150) | public function testFromStringWithTrailingNewLine(): void
method testFromStringWithUrn (line 158) | public function testFromStringWithUrn(): void
method testFromStringWithEmptyString (line 164) | public function testFromStringWithEmptyString(): void
method testFromStringUppercase (line 172) | public function testFromStringUppercase(): void
method testFromStringLazyUuidFromUppercase (line 178) | public function testFromStringLazyUuidFromUppercase(): void
method testFromStringWithNilUuid (line 183) | public function testFromStringWithNilUuid(): void
method testFromStringWithMaxUuid (line 195) | public function testFromStringWithMaxUuid(): void
method testGetBytes (line 207) | public function testGetBytes(): void
method testGetClockSeqHiAndReserved (line 214) | public function testGetClockSeqHiAndReserved(): void
method testGetClockSeqHiAndReservedHex (line 221) | public function testGetClockSeqHiAndReservedHex(): void
method testGetClockSeqLow (line 228) | public function testGetClockSeqLow(): void
method testGetClockSeqLowHex (line 235) | public function testGetClockSeqLowHex(): void
method testGetClockSequence (line 242) | public function testGetClockSequence(): void
method testGetClockSequenceHex (line 249) | public function testGetClockSequenceHex(): void
method testGetDateTime (line 256) | public function testGetDateTime(): void
method testGetDateTimeForUuidV6 (line 291) | public function testGetDateTimeForUuidV6(): void
method testGetDateTimeFromNonVersion1Uuid (line 326) | public function testGetDateTimeFromNonVersion1Uuid(): void
method testGetFields (line 337) | public function testGetFields(): void
method testGetFieldsHex (line 345) | public function testGetFieldsHex(): void
method testGetLeastSignificantBits (line 361) | public function testGetLeastSignificantBits(): void
method testGetLeastSignificantBitsHex (line 369) | public function testGetLeastSignificantBitsHex(): void
method testGetMostSignificantBits (line 376) | public function testGetMostSignificantBits(): void
method testGetMostSignificantBitsHex (line 384) | public function testGetMostSignificantBitsHex(): void
method testGetNode (line 390) | public function testGetNode(): void
method testGetNodeHex (line 397) | public function testGetNodeHex(): void
method testGetTimeHiAndVersion (line 403) | public function testGetTimeHiAndVersion(): void
method testGetTimeHiAndVersionHex (line 410) | public function testGetTimeHiAndVersionHex(): void
method testGetTimeLow (line 416) | public function testGetTimeLow(): void
method testGetTimeLowHex (line 423) | public function testGetTimeLowHex(): void
method testGetTimeMid (line 429) | public function testGetTimeMid(): void
method testGetTimeMidHex (line 436) | public function testGetTimeMidHex(): void
method testGetTimestamp (line 442) | public function testGetTimestamp(): void
method testGetTimestampHex (line 455) | public function testGetTimestampHex(): void
method testGetTimestampFromNonVersion1Uuid (line 466) | public function testGetTimestampFromNonVersion1Uuid(): void
method testGetTimestampHexFromNonVersion1Uuid (line 478) | public function testGetTimestampHexFromNonVersion1Uuid(): void
method testGetUrn (line 489) | public function testGetUrn(): void
method testGetVariantForVariousVariantUuids (line 500) | public function testGetVariantForVariousVariantUuids(string $uuid, int...
method provideVariousVariantUuids (line 509) | public function provideVariousVariantUuids(): array
method testGetVersionForVersion1 (line 531) | public function testGetVersionForVersion1(): void
method testGetVersionForVersion2 (line 537) | public function testGetVersionForVersion2(): void
method testGetVersionForVersion3 (line 543) | public function testGetVersionForVersion3(): void
method testGetVersionForVersion4 (line 549) | public function testGetVersionForVersion4(): void
method testGetVersionForVersion5 (line 555) | public function testGetVersionForVersion5(): void
method testToString (line 561) | public function testToString(): void
method testUuid1 (line 582) | public function testUuid1(): void
method testUuid1WithNodeAndClockSequence (line 589) | public function testUuid1WithNodeAndClockSequence(): void
method testUuid1WithHexadecimalObjectNodeAndClockSequence (line 601) | public function testUuid1WithHexadecimalObjectNodeAndClockSequence(): ...
method testUuid1WithHexadecimalNode (line 613) | public function testUuid1WithHexadecimalNode(): void
method testUuid1WithHexadecimalObjectNode (line 625) | public function testUuid1WithHexadecimalObjectNode(): void
method testUuid1WithMixedCaseHexadecimalNode (line 637) | public function testUuid1WithMixedCaseHexadecimalNode(): void
method testUuid1WithOutOfBoundsNode (line 649) | public function testUuid1WithOutOfBoundsNode(): void
method testUuid1WithNonHexadecimalNode (line 657) | public function testUuid1WithNonHexadecimalNode(): void
method testUuid1WithNon48bitNumber (line 665) | public function testUuid1WithNon48bitNumber(): void
method testUuid1WithRandomNode (line 673) | public function testUuid1WithRandomNode(): void
method testUuid1WithUserGeneratedRandomNode (line 682) | public function testUuid1WithUserGeneratedRandomNode(): void
method testUuid6 (line 689) | public function testUuid6(): void
method testUuid6WithNodeAndClockSequence (line 696) | public function testUuid6WithNodeAndClockSequence(): void
method testUuid6WithHexadecimalNode (line 706) | public function testUuid6WithHexadecimalNode(): void
method testUuid6WithMixedCaseHexadecimalNode (line 715) | public function testUuid6WithMixedCaseHexadecimalNode(): void
method testUuid6WithOutOfBoundsNode (line 724) | public function testUuid6WithOutOfBoundsNode(): void
method testUuid6WithNon48bitNumber (line 732) | public function testUuid6WithNon48bitNumber(): void
method testUuid6WithRandomNode (line 740) | public function testUuid6WithRandomNode(): void
method testUuid6WithUserGeneratedRandomNode (line 749) | public function testUuid6WithUserGeneratedRandomNode(): void
method testUuid7 (line 756) | public function testUuid7(): void
method testUuid7ThrowsExceptionForUnsupportedFactory (line 763) | public function testUuid7ThrowsExceptionForUnsupportedFactory(): void
method testUuid7WithDateTime (line 776) | public function testUuid7WithDateTime(): void
method testUuid7SettingTheClockBackwards (line 789) | public function testUuid7SettingTheClockBackwards(): void
method testUuid7WithMinimumDateTime (line 808) | public function testUuid7WithMinimumDateTime(): void
method testUuid7EachUuidIsMonotonicallyIncreasing (line 821) | public function testUuid7EachUuidIsMonotonicallyIncreasing(): void
method testUuid7EachUuidFromSameDateTimeIsMonotonicallyIncreasing (line 834) | public function testUuid7EachUuidFromSameDateTimeIsMonotonicallyIncrea...
method testUuid8 (line 847) | public function testUuid8(): void
method testUuid8ThrowsExceptionForUnsupportedFactory (line 854) | public function testUuid8ThrowsExceptionForUnsupportedFactory(): void
method testUuid3WithKnownUuids (line 880) | public function testUuid3WithKnownUuids(string $uuid, string $ns, stri...
method provideUuid3WithKnownUuids (line 894) | public function provideUuid3WithKnownUuids(): array
method testUuid4 (line 920) | public function testUuid4(): void
method testUuid4TimestampLastComb (line 930) | public function testUuid4TimestampLastComb(): void
method testUuid4TimestampFirstComb (line 960) | public function testUuid4TimestampFirstComb(): void
method testUuid4CombVersion (line 990) | public function testUuid4CombVersion(): void
method testUuid5WithKnownUuids (line 1017) | public function testUuid5WithKnownUuids(string $uuid, string $ns, stri...
method provideUuid5WithKnownUuids (line 1031) | public function provideUuid5WithKnownUuids(): array
method testCompareTo (line 1057) | public function testCompareTo(): void
method testCompareToReturnsZeroWhenDifferentCases (line 1083) | public function testCompareToReturnsZeroWhenDifferentCases(): void
method testEqualsReturnsTrueWhenDifferentCases (line 1094) | public function testEqualsReturnsTrueWhenDifferentCases(): void
method testEquals (line 1105) | public function testEquals(): void
method testCalculateUuidTime (line 1116) | public function testCalculateUuidTime(): void
method testCalculateUuidTimeUpperLowerBounds (line 1151) | public function testCalculateUuidTimeUpperLowerBounds(): void
method test32BitMatch64BitForOneHourPeriod (line 1185) | public function test32BitMatch64BitForOneHourPeriod(): void
method testIsValid (line 1230) | public function testIsValid(): void
method testUsingNilAsValidUuid (line 1248) | public function testUsingNilAsValidUuid(): void
method testFromBytes (line 1262) | public function testFromBytes(): void
method testGuidBytesMatchesUuidWithSameString (line 1272) | public function testGuidBytesMatchesUuidWithSameString(): void
method testGuidBytesProducesSameGuidString (line 1292) | public function testGuidBytesProducesSameGuidString(): void
method testFromBytesArgumentTooShort (line 1305) | public function testFromBytesArgumentTooShort(): void
method testFromBytesArgumentTooLong (line 1312) | public function testFromBytesArgumentTooLong(): void
method testFromInteger (line 1319) | public function testFromInteger(): void
method testFromDateTime (line 1329) | public function testFromDateTime(): void
method testUuidPassesPythonTests (line 1356) | public function testUuidPassesPythonTests(
method providePythonTests (line 1419) | public function providePythonTests(): array
method testJsonSerialize (line 1714) | public function testJsonSerialize(): void
method testSerialize (line 1721) | public function testSerialize(): void
method testSerializeWithOldStringFormat (line 1732) | public function testSerializeWithOldStringFormat(): void
method testUuid3WithEmptyNamespace (line 1742) | public function testUuid3WithEmptyNamespace(): void
method testUuid3WithEmptyName (line 1751) | public function testUuid3WithEmptyName(): void
method testUuid3WithZeroName (line 1758) | public function testUuid3WithZeroName(): void
method testUuid5WithEmptyNamespace (line 1765) | public function testUuid5WithEmptyNamespace(): void
method testUuid5WithEmptyName (line 1774) | public function testUuid5WithEmptyName(): void
method testUuid5WithZeroName (line 1781) | public function testUuid5WithZeroName(): void
method testUuidVersionConstantForVersion1 (line 1791) | public function testUuidVersionConstantForVersion1(): void
method testUuidVersionConstantForVersion2 (line 1800) | public function testUuidVersionConstantForVersion2(): void
method testUuidVersionConstantForVersion3 (line 1809) | public function testUuidVersionConstantForVersion3(): void
method testUuidVersionConstantForVersion4 (line 1818) | public function testUuidVersionConstantForVersion4(): void
method testUuidVersionConstantForVersion5 (line 1827) | public function testUuidVersionConstantForVersion5(): void
method testUuidVersionConstantForVersion6 (line 1833) | public function testUuidVersionConstantForVersion6(): void
method testUuidVersionConstantForVersion7 (line 1840) | public function testUuidVersionConstantForVersion7(): void
method testGetDateTimeThrowsExceptionWhenDateTimeCannotParseDate (line 1846) | public function testGetDateTimeThrowsExceptionWhenDateTimeCannotParseD...
method testStaticCreationMethodsReturnSpecificUuidInstances (line 1877) | public function testStaticCreationMethodsReturnSpecificUuidInstances(
method testUuidInstancesBuiltFromStringAreEquivalentToTheirGeneratedCounterparts (line 1889) | public function testUuidInstancesBuiltFromStringAreEquivalentToTheirGe...
method testUuidInstancesBuiltFromBytesAreEquivalentToTheirGeneratedCounterparts (line 1907) | public function testUuidInstancesBuiltFromBytesAreEquivalentToTheirGen...
method provideStaticMethods (line 1923) | public function provideStaticMethods(): array
FILE: tests/Validator/GenericValidatorTest.php
class GenericValidatorTest (line 13) | class GenericValidatorTest extends TestCase
method testValidate (line 18) | public function testValidate(string $value, bool $expected): void
method provideValuesForValidation (line 39) | public function provideValuesForValidation(): array
method testGetPattern (line 90) | public function testGetPattern(): void
FILE: tests/benchmark/GuidConversionBench.php
class GuidConversionBench (line 22) | final class GuidConversionBench
method __construct (line 30) | public function __construct()
method benchStringConversionOfGuid (line 39) | public function benchStringConversionOfGuid(): void
FILE: tests/benchmark/NonLazyUuidConversionBench.php
class NonLazyUuidConversionBench (line 20) | final class NonLazyUuidConversionBench
method __construct (line 28) | public function __construct()
method benchStringConversionOfUuid (line 35) | public function benchStringConversionOfUuid(): void
FILE: tests/benchmark/UuidFieldExtractionBench.php
class UuidFieldExtractionBench (line 20) | final class UuidFieldExtractionBench
method __construct (line 25) | public function __construct()
method benchGetFields (line 30) | public function benchGetFields(): void
method benchGetFields10Times (line 35) | public function benchGetFields10Times(): void
method benchGetHex (line 49) | public function benchGetHex(): void
method benchGetHex10Times (line 54) | public function benchGetHex10Times(): void
method benchGetInteger (line 68) | public function benchGetInteger(): void
method benchGetInteger10Times (line 73) | public function benchGetInteger10Times(): void
FILE: tests/benchmark/UuidGenerationBench.php
class UuidGenerationBench (line 24) | final class UuidGenerationBench
method __construct (line 35) | public function __construct()
method benchUuid1GenerationWithoutParameters (line 44) | public function benchUuid1GenerationWithoutParameters(): void
method benchUuid1GenerationWithNode (line 49) | public function benchUuid1GenerationWithNode(): void
method benchUuid1GenerationWithNodeAndClockSequence (line 54) | public function benchUuid1GenerationWithNodeAndClockSequence(): void
method benchUuid2GenerationWithDomainAndLocalIdentifier (line 59) | public function benchUuid2GenerationWithDomainAndLocalIdentifier(): void
method benchUuid2GenerationWithDomainAndLocalIdentifierAndNode (line 64) | public function benchUuid2GenerationWithDomainAndLocalIdentifierAndNod...
method benchUuid2GenerationWithDomainAndLocalIdentifierAndNodeAndClockSequence (line 69) | public function benchUuid2GenerationWithDomainAndLocalIdentifierAndNod...
method benchUuid3Generation (line 74) | public function benchUuid3Generation(): void
method benchUuid4Generation (line 79) | public function benchUuid4Generation(): void
method benchUuid5Generation (line 84) | public function benchUuid5Generation(): void
method benchUuid6GenerationWithoutParameters (line 89) | public function benchUuid6GenerationWithoutParameters(): void
method benchUuid6GenerationWithNode (line 94) | public function benchUuid6GenerationWithNode(): void
method benchUuid6GenerationWithNodeAndClockSequence (line 99) | public function benchUuid6GenerationWithNodeAndClockSequence(): void
method benchUuid7Generation (line 104) | public function benchUuid7Generation(): void
method benchUuid7GenerationWithDateTime (line 109) | public function benchUuid7GenerationWithDateTime(): void
FILE: tests/benchmark/UuidSerializationBench.php
class UuidSerializationBench (line 23) | final class UuidSerializationBench
method __construct (line 150) | public function __construct()
method benchSerializationOfTinyUuid (line 165) | public function benchSerializationOfTinyUuid(): void
method benchSerializationOfHugeUuid (line 170) | public function benchSerializationOfHugeUuid(): void
method benchSerializationOfUuid (line 175) | public function benchSerializationOfUuid(): void
method benchSerializationOfPromiscuousUuids (line 180) | public function benchSerializationOfPromiscuousUuids(): void
method benchDeSerializationOfTinyUuid (line 185) | public function benchDeSerializationOfTinyUuid(): void
method benchDeSerializationOfHugeUuid (line 190) | public function benchDeSerializationOfHugeUuid(): void
method benchDeSerializationOfUuid (line 195) | public function benchDeSerializationOfUuid(): void
method benchDeSerializationOfPromiscuousUuids (line 200) | public function benchDeSerializationOfPromiscuousUuids(): void
FILE: tests/benchmark/UuidStringConversionBench.php
class UuidStringConversionBench (line 22) | final class UuidStringConversionBench
method __construct (line 155) | public function __construct()
method benchCreationOfTinyUuidFromString (line 169) | public function benchCreationOfTinyUuidFromString(): void
method benchCreationOfHugeUuidFromString (line 174) | public function benchCreationOfHugeUuidFromString(): void
method benchCreationOfUuidFromString (line 179) | public function benchCreationOfUuidFromString(): void
method benchCreationOfPromiscuousUuidsFromString (line 184) | public function benchCreationOfPromiscuousUuidsFromString(): void
method benchCreationOfTinyUuidFromBytes (line 189) | public function benchCreationOfTinyUuidFromBytes(): void
method benchCreationOfHugeUuidFromBytes (line 194) | public function benchCreationOfHugeUuidFromBytes(): void
method benchCreationOfUuidFromBytes (line 199) | public function benchCreationOfUuidFromBytes(): void
method benchCreationOfPromiscuousUuidsFromBytes (line 204) | public function benchCreationOfPromiscuousUuidsFromBytes(): void
method benchStringConversionOfTinyUuid (line 209) | public function benchStringConversionOfTinyUuid(): void
method benchStringConversionOfHugeUuid (line 214) | public function benchStringConversionOfHugeUuid(): void
method benchStringConversionOfUuid (line 219) | public function benchStringConversionOfUuid(): void
method benchStringConversionOfPromiscuousUuids (line 224) | public function benchStringConversionOfPromiscuousUuids(): void
method benchBytesConversionOfTinyUuid (line 231) | public function benchBytesConversionOfTinyUuid(): void
method benchBytesConversionOfHugeUuid (line 236) | public function benchBytesConversionOfHugeUuid(): void
method benchBytesConversionOfUuid (line 241) | public function benchBytesConversionOfUuid(): void
method benchBytesConversionOfPromiscuousUuids (line 246) | public function benchBytesConversionOfPromiscuousUuids(): void
FILE: tests/static-analysis/UuidIsImmutable.php
class UuidIsImmutable (line 30) | final class UuidIsImmutable
method pureCompareTo (line 32) | public static function pureCompareTo(UuidInterface $a, UuidInterface $...
method pureEquals (line 37) | public static function pureEquals(UuidInterface $a, ?object $b): bool
method pureGetters (line 45) | public static function pureGetters(UuidInterface $a): array
method pureStaticUuidApi (line 75) | public static function pureStaticUuidApi(): array
method uuid3IsPure (line 86) | public static function uuid3IsPure(): UuidInterface
method uuid5IsPure (line 94) | public static function uuid5IsPure(): UuidInterface
FILE: tests/static-analysis/UuidIsNeverEmpty.php
class UuidIsNeverEmpty (line 23) | final class UuidIsNeverEmpty
method bytesAreNeverEmpty (line 26) | public function bytesAreNeverEmpty(UuidInterface $uuid): string
method stringIsNeverEmpty (line 32) | public function stringIsNeverEmpty(UuidInterface $uuid): string
FILE: tests/static-analysis/ValidUuidIsNonEmpty.php
class ValidUuidIsNonEmpty (line 10) | final class ValidUuidIsNonEmpty
method validUuidsAreNotEmpty (line 13) | public function validUuidsAreNotEmpty(string $input): string
method givenNonEmptyInputAssertionRemainsValid (line 27) | public function givenNonEmptyInputAssertionRemainsValid(string $input)...
method givenInvalidInputValueRemainsAString (line 36) | public function givenInvalidInputValueRemainsAString(string $input): s...
FILE: tests/static-analysis/stubs.php
function uuid_create (line 19) | function uuid_create(int $uuid_type=UUID_TYPE_DEFAULT): string {}
function uuid_generate_md5 (line 22) | function uuid_generate_md5(string $uuid_ns, string $name): string {}
function uuid_generate_sha1 (line 25) | function uuid_generate_sha1(string $uuid_ns, string $name): string {}
function uuid_parse (line 28) | function uuid_parse(string $uuid): string {}
Condensed preview — 287 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,082K chars).
[
{
"path": ".editorconfig",
"chars": 276,
"preview": "# EditorConfig http://EditorConfig.org\n\n# top-most EditorConfig file\nroot = true\n\n# This applies to all files\n[*]\nend_of"
},
{
"path": ".gitattributes",
"chars": 1008,
"preview": "/.allowed-licenses export-ignore\n/.editorconfig export-ignore\n/.gitattributes export-i"
},
{
"path": ".github/CODEOWNERS",
"chars": 10,
"preview": "* @ramsey\n"
},
{
"path": ".github/ISSUE_TEMPLATE/Bug_Report.md",
"chars": 1138,
"preview": "---\nname: Bug Report\nabout: Create a bug report to help us improve\nlabels: bug\nassignees:\n---\n<!--- Provide a general su"
},
{
"path": ".github/ISSUE_TEMPLATE/Feature_Request.md",
"chars": 928,
"preview": "---\nname: Feature Request\nabout: Suggest a feature for this project\nlabels: enhancement\nassignees:\n---\n<!--- Provide a g"
},
{
"path": ".github/ISSUE_TEMPLATE/Question.md",
"chars": 626,
"preview": "---\nname: Question\nabout: Ask a question about how to use this library\nlabels: question\nassignees:\n---\n<!--- Provide a g"
},
{
"path": ".github/ISSUE_TEMPLATE/config.yml",
"chars": 28,
"preview": "blank_issues_enabled: false\n"
},
{
"path": ".github/dependabot.yml",
"chars": 363,
"preview": "version: 2\nupdates:\n - package-ecosystem: \"composer\"\n allow:\n - dependency-type: all\n directory: \"/\"\n sch"
},
{
"path": ".github/pull_request_template.md",
"chars": 1267,
"preview": "<!--- Provide a general summary of your changes in the title above. -->\n\n## Description\n<!--- Describe your changes in d"
},
{
"path": ".github/workflows/continuous-integration.yml",
"chars": 5400,
"preview": "# GitHub Actions Documentation: https://docs.github.com/en/actions\n\nname: \"Continuous Integration\"\n\non:\n push:\n bran"
},
{
"path": ".github/workflows/merge-me.yml",
"chars": 949,
"preview": "# Merge Me! Documentation: https://github.com/ridedott/merge-me-action/\n\nname: \"Merge Dependabot PRs\"\n\non:\n workflow_ru"
},
{
"path": ".gitignore",
"chars": 58,
"preview": "/captainhook.config.json\n/phpcs.xml\n/phpunit.xml\n/vendor/\n"
},
{
"path": ".readthedocs.yml",
"chars": 181,
"preview": "version: 2\n\nbuild:\n os: ubuntu-22.04\n tools:\n python: \"3.12\"\n\nsphinx:\n configuration: docs/conf.py\n\nformats: all\n\n"
},
{
"path": "CHANGELOG.md",
"chars": 55162,
"preview": "# ramsey/uuid Changelog\n\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [K"
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 3165,
"preview": "# Contributor Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, we as\ncont"
},
{
"path": "CONTRIBUTING.md",
"chars": 5489,
"preview": "# Contributing\n\nContributions are welcome. This project accepts pull requests on [GitHub][].\n\nThis project adheres to a "
},
{
"path": "LICENSE",
"chars": 1079,
"preview": "Copyright (c) 2012-2025 Ben Ramsey <ben@benramsey.com>\n\nPermission is hereby granted, free of charge, to any person obta"
},
{
"path": "README.md",
"chars": 3885,
"preview": "<h1 align=\"center\">ramsey/uuid</h1>\n\n<p align=\"center\">\n <strong>A PHP library for generating and working with UUIDs."
},
{
"path": "SECURITY.md",
"chars": 7893,
"preview": "<!--\n This policy template was created using the HackerOne Policy Builder [1],\n with guidance from the National Te"
},
{
"path": "build/.gitignore",
"chars": 58,
"preview": "*\n!.gitignore\n!cache\n!cache/.gitkeep\n!logs\n!logs/.gitkeep\n"
},
{
"path": "build/cache/.gitkeep",
"chars": 0,
"preview": ""
},
{
"path": "build/logs/.gitkeep",
"chars": 0,
"preview": ""
},
{
"path": "captainhook.json",
"chars": 2909,
"preview": "{\n \"config\": {\n \"ansi-colors\": true,\n \"fail-on-first-error\": false,\n \"plugins\": [],\n \"ver"
},
{
"path": "codecov.yml",
"chars": 544,
"preview": "codecov:\n require_ci_to_pass: yes\n\ncoverage:\n precision: 2\n round: down\n range: \"70...100\"\n status:\n "
},
{
"path": "composer.json",
"chars": 4756,
"preview": "{\n \"name\": \"ramsey/uuid\",\n \"description\": \"A PHP library for generating and working with universally unique identi"
},
{
"path": "docs/.gitignore",
"chars": 8,
"preview": "_build/\n"
},
{
"path": "docs/LICENSE",
"chars": 18652,
"preview": "Attribution 4.0 International\n\n=======================================================================\n\nCreative Commons"
},
{
"path": "docs/Makefile",
"chars": 634,
"preview": "# Minimal makefile for Sphinx documentation\n#\n\n# You can set these variables from the command line, and also\n# from the "
},
{
"path": "docs/README.md",
"chars": 734,
"preview": "# ramsey/uuid Documentation\n\nChanges to the documentation are automatically built by [Read the Docs][] and viewable from"
},
{
"path": "docs/_static/.gitkeep",
"chars": 0,
"preview": ""
},
{
"path": "docs/conf.py",
"chars": 3288,
"preview": "# Configuration file for the Sphinx documentation builder.\n#\n# This file only contains a selection of the most common op"
},
{
"path": "docs/copyright.rst",
"chars": 1085,
"preview": ".. _copyright:\n\n=========\nCopyright\n=========\n\nCopyright © 2012-|current_year| `Ben Ramsey <https://benramsey.com>`_ and"
},
{
"path": "docs/customize/calculators.rst",
"chars": 2356,
"preview": ".. _customize.calculators:\n\n=========================\nUsing a Custom Calculator\n=========================\n\nBy default, r"
},
{
"path": "docs/customize/factory.rst",
"chars": 3180,
"preview": ".. _customize.factory:\n\n===========================\nReplace the Default Factory\n===========================\n\nIn many of "
},
{
"path": "docs/customize/ordered-time-codec.rst",
"chars": 3233,
"preview": ".. _customize.ordered-time-codec:\n\n==================\nOrdered-time Codec\n==================\n\n.. attention::\n\n The :ph"
},
{
"path": "docs/customize/timestamp-first-comb-codec.rst",
"chars": 2795,
"preview": ".. _customize.timestamp-first-comb-codec:\n\n==========================\nTimestamp-first COMB Codec\n======================="
},
{
"path": "docs/customize/validators.rst",
"chars": 1572,
"preview": ".. _customize.validators:\n\n========================\nUsing a Custom Validator\n========================\n\nBy default, ramse"
},
{
"path": "docs/customize.rst",
"chars": 2308,
"preview": ".. _customize:\n\n=============\nCustomization\n=============\n\n.. toctree::\n :titlesonly:\n :hidden:\n\n customize/ord"
},
{
"path": "docs/database.rst",
"chars": 8015,
"preview": ".. _database:\n\n===================\nUsing In a Database\n===================\n\n.. tip::\n\n `ramsey/uuid-doctrine`_ allows"
},
{
"path": "docs/faq.rst",
"chars": 5422,
"preview": ".. _faq:\n\n=================================\nFrequently Asked Questions (FAQs)\n=================================\n\n.. cont"
},
{
"path": "docs/index.rst",
"chars": 466,
"preview": ".. _index:\n\n======================\nramsey/uuid User Guide\n======================\n\nFor `ramsey/uuid <https://github.com/r"
},
{
"path": "docs/introduction.rst",
"chars": 1085,
"preview": ".. _introduction:\n\n============\nIntroduction\n============\n\nramsey/uuid is a PHP library for generating and working with "
},
{
"path": "docs/nonstandard/guid.rst",
"chars": 5845,
"preview": ".. _nonstandard.guid:\n\n===================================\nGlobally Unique Identifiers (GUIDs)\n========================="
},
{
"path": "docs/nonstandard/other.rst",
"chars": 1667,
"preview": ".. _nonstandard.other:\n\n=======================\nOther Nonstandard UUIDs\n=======================\n\nSometimes, you might en"
},
{
"path": "docs/nonstandard/version6.rst",
"chars": 407,
"preview": ".. _nonstandard.version6:\n\n===================================\nVersion 6: Reordered Gregorian Time\n====================="
},
{
"path": "docs/nonstandard.rst",
"chars": 1246,
"preview": ".. _nonstandard:\n\n=================\nNonstandard UUIDs\n=================\n\n.. toctree::\n :titlesonly:\n :hidden:\n\n "
},
{
"path": "docs/quickstart.rst",
"chars": 4112,
"preview": ".. _quickstart:\n\n===============\nGetting Started\n===============\n\nRequirements\n############\n\nramsey/uuid |version| requi"
},
{
"path": "docs/reference/calculators.rst",
"chars": 6808,
"preview": ".. _reference.calculators:\n\n===========\nCalculators\n===========\n\n.. php:namespace:: Ramsey\\Uuid\\Math\n\n.. php:interface::"
},
{
"path": "docs/reference/exceptions.rst",
"chars": 2786,
"preview": ".. _reference.exceptions:\n\n==========\nExceptions\n==========\n\nAll exceptions in the :php:ns:`Ramsey\\\\Uuid` namespace impl"
},
{
"path": "docs/reference/fields-fieldsinterface.rst",
"chars": 347,
"preview": ".. _reference.fields.fieldsinterface:\n\n========================\nFields\\\\FieldsInterface\n========================\n\n.. php"
},
{
"path": "docs/reference/guid-fields.rst",
"chars": 250,
"preview": ".. _reference.guid.fields:\n\n============\nGuid\\\\Fields\n============\n\n.. php:namespace:: Ramsey\\Uuid\\Guid\n\n.. php:class:: "
},
{
"path": "docs/reference/guid-guid.rst",
"chars": 486,
"preview": ".. _reference.guid.guid:\n\n==========\nGuid\\\\Guid\n==========\n\n.. php:namespace:: Ramsey\\Uuid\\Guid\n\n.. php:class:: Guid\n\n "
},
{
"path": "docs/reference/helper.rst",
"chars": 3739,
"preview": ".. _reference.helper:\n\n================\nHelper Functions\n================\n\nramsey/uuid additionally provides the followi"
},
{
"path": "docs/reference/name-based-namespaces.rst",
"chars": 1196,
"preview": ".. _reference.name-based-namespaces:\n\n=====================\nPredefined Namespaces\n=====================\n\n`RFC 9562`_ (fo"
},
{
"path": "docs/reference/nonstandard-fields.rst",
"chars": 305,
"preview": ".. _reference.nonstandard.fields:\n\n===================\nNonstandard\\\\Fields\n===================\n\n.. php:namespace:: Ramse"
},
{
"path": "docs/reference/nonstandard-uuid.rst",
"chars": 539,
"preview": ".. _reference.nonstandard.uuid:\n\n=================\nNonstandard\\\\Uuid\n=================\n\n.. php:namespace:: Ramsey\\Uuid\\N"
},
{
"path": "docs/reference/nonstandard-uuidv6.rst",
"chars": 1241,
"preview": ".. _reference.nonstandard.uuidv6:\n\n===================\nNonstandard\\\\UuidV6\n===================\n\n.. php:namespace:: Ramse"
},
{
"path": "docs/reference/rfc4122-fieldsinterface.rst",
"chars": 2465,
"preview": ".. _reference.rfc4122.fieldsinterface:\n\n========================\nRfc4122\\\\FieldsInterface\n========================\n\n.. p"
},
{
"path": "docs/reference/rfc4122-uuidinterface.rst",
"chars": 697,
"preview": ".. _reference.rfc4122.uuidinterface:\n\n======================\nRfc4122\\\\UuidInterface\n======================\n\n.. php:names"
},
{
"path": "docs/reference/rfc4122-uuidv1.rst",
"chars": 584,
"preview": ".. _reference.rfc4122.uuidv1:\n\n===============\nRfc4122\\\\UuidV1\n===============\n\n.. php:namespace:: Ramsey\\Uuid\\Rfc4122\n\n"
},
{
"path": "docs/reference/rfc4122-uuidv2.rst",
"chars": 1595,
"preview": ".. _reference.rfc4122.uuidv2:\n\n===============\nRfc4122\\\\UuidV2\n===============\n\n.. php:namespace:: Ramsey\\Uuid\\Rfc4122\n\n"
},
{
"path": "docs/reference/rfc4122-uuidv3.rst",
"chars": 305,
"preview": ".. _reference.rfc4122.uuidv3:\n\n===============\nRfc4122\\\\UuidV3\n===============\n\n.. php:namespace:: Ramsey\\Uuid\\Rfc4122\n\n"
},
{
"path": "docs/reference/rfc4122-uuidv4.rst",
"chars": 288,
"preview": ".. _reference.rfc4122.uuidv4:\n\n===============\nRfc4122\\\\UuidV4\n===============\n\n.. php:namespace:: Ramsey\\Uuid\\Rfc4122\n\n"
},
{
"path": "docs/reference/rfc4122-uuidv5.rst",
"chars": 307,
"preview": ".. _reference.rfc4122.uuidv5:\n\n===============\nRfc4122\\\\UuidV5\n===============\n\n.. php:namespace:: Ramsey\\Uuid\\Rfc4122\n\n"
},
{
"path": "docs/reference/rfc4122-uuidv6.rst",
"chars": 987,
"preview": ".. _reference.rfc4122.uuidv6:\n\n===============\nRfc4122\\\\UuidV6\n===============\n\n.. php:namespace:: Ramsey\\Uuid\\Rfc4122\n\n"
},
{
"path": "docs/reference/rfc4122-uuidv7.rst",
"chars": 585,
"preview": ".. _reference.rfc4122.uuidv7:\n\n===============\nRfc4122\\\\UuidV7\n===============\n\n.. php:namespace:: Ramsey\\Uuid\\Rfc4122\n\n"
},
{
"path": "docs/reference/rfc4122-uuidv8.rst",
"chars": 320,
"preview": ".. _reference.rfc4122.uuidv8:\n\n===============\nRfc4122\\\\UuidV8\n===============\n\n.. php:namespace:: Ramsey\\Uuid\\Rfc4122\n\n"
},
{
"path": "docs/reference/types.rst",
"chars": 2410,
"preview": ".. _reference.types:\n\n=====\nTypes\n=====\n\n.. php:namespace:: Ramsey\\Uuid\\Type\n\n.. php:class:: TypeInterface\n\n Implemen"
},
{
"path": "docs/reference/uuid.rst",
"chars": 7799,
"preview": ".. _reference.uuid:\n\n====\nUuid\n====\n\nRamsey\\\\Uuid\\\\Uuid provides static methods for the most common functionality for ge"
},
{
"path": "docs/reference/uuidfactoryinterface.rst",
"chars": 4039,
"preview": ".. _reference.uuidfactoryinterface:\n\n====================\nUuidFactoryInterface\n====================\n\n.. php:namespace:: "
},
{
"path": "docs/reference/uuidinterface.rst",
"chars": 1661,
"preview": ".. _reference.uuidinterface:\n\n=============\nUuidInterface\n=============\n\n.. php:namespace:: Ramsey\\Uuid\n\n.. php:interfac"
},
{
"path": "docs/reference/validators.rst",
"chars": 1020,
"preview": ".. _reference.validators:\n\n==========\nValidators\n==========\n\n.. php:namespace:: Ramsey\\Uuid\\Validator\n\n.. php:interface:"
},
{
"path": "docs/reference.rst",
"chars": 803,
"preview": ".. _reference:\n\n=========\nReference\n=========\n\n.. toctree::\n :titlesonly:\n\n reference/uuid\n reference/uuidinter"
},
{
"path": "docs/requirements.txt",
"chars": 70,
"preview": "Sphinx==7.3.7\nsphinx-rtd-theme==2.0.0\nsphinxcontrib-phpdomain==0.11.1\n"
},
{
"path": "docs/rfc4122/version1.rst",
"chars": 6549,
"preview": ".. _rfc4122.version1:\n\n=========================\nVersion 1: Gregorian Time\n=========================\n\n.. attention::\n\n "
},
{
"path": "docs/rfc4122/version2.rst",
"chars": 10366,
"preview": ".. _rfc4122.version2:\n\n=======================\nVersion 2: DCE Security\n=======================\n\n.. tip::\n\n DCE Securi"
},
{
"path": "docs/rfc4122/version3.rst",
"chars": 2345,
"preview": ".. _rfc4122.version3:\n\n===========================\nVersion 3: Name-based (MD5)\n===========================\n\n.. attention"
},
{
"path": "docs/rfc4122/version4.rst",
"chars": 1069,
"preview": ".. _rfc4122.version4:\n\n=================\nVersion 4: Random\n=================\n\nVersion 4 UUIDs are perhaps the most popul"
},
{
"path": "docs/rfc4122/version5.rst",
"chars": 4199,
"preview": ".. _rfc4122.version5:\n\n=============================\nVersion 5: Name-based (SHA-1)\n=============================\n\n.. dan"
},
{
"path": "docs/rfc4122/version6.rst",
"chars": 6503,
"preview": ".. _rfc4122.version6:\n\n===================================\nVersion 6: Reordered Gregorian Time\n========================="
},
{
"path": "docs/rfc4122/version7.rst",
"chars": 5501,
"preview": ".. _rfc4122.version7:\n\n==========================\nVersion 7: Unix Epoch Time\n==========================\n\n.. admonition::"
},
{
"path": "docs/rfc4122/version8.rst",
"chars": 1334,
"preview": ".. _rfc4122.version8:\n\n========================\nVersion 8: Custom Format\n========================\n\nVersion 8 UUIDs allow"
},
{
"path": "docs/rfc4122.rst",
"chars": 2560,
"preview": ".. _rfc4122:\n\n==================================\nRFC 9562 (formerly RFC 4122) UUIDs\n==================================\n\n"
},
{
"path": "docs/testing.rst",
"chars": 6039,
"preview": ".. _testing:\n\n==================\nTesting With UUIDs\n==================\n\nOne problem with the use of ``final`` is the ina"
},
{
"path": "docs/upgrading/2-to-3.rst",
"chars": 1311,
"preview": ".. _upgrading.2-to-3:\n\n==============\nVersion 2 to 3\n==============\n\nWhile we have made significant internal changes to "
},
{
"path": "docs/upgrading/3-to-4.rst",
"chars": 19836,
"preview": ".. _upgrading.3-to-4:\n\n==============\nVersion 3 to 4\n==============\n\nI've made great efforts to ensure that the upgrade "
},
{
"path": "docs/upgrading.rst",
"chars": 156,
"preview": ".. _upgrading:\n\n=====================\nUpgrading ramsey/uuid\n=====================\n\n.. toctree::\n :titlesonly:\n\n up"
},
{
"path": "phpbench.json",
"chars": 220,
"preview": "{\n \"runner.bootstrap\": \"vendor/autoload.php\",\n \"runner.path\": \"tests/benchmark\",\n \"runner.retry_threshold\": 5,\n"
},
{
"path": "phpcs.xml.dist",
"chars": 20086,
"preview": "<?xml version=\"1.0\"?>\n<ruleset xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"vend"
},
{
"path": "phpstan.neon.dist",
"chars": 521,
"preview": "parameters:\n tmpDir: ./build/cache/phpstan\n level: max\n treatPhpDocTypesAsCertain: false\n paths:\n - ."
},
{
"path": "phpunit.xml.dist",
"chars": 749,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:noNam"
},
{
"path": "resources/vagrant/.gitignore",
"chars": 10,
"preview": ".vagrant/\n"
},
{
"path": "resources/vagrant/README.md",
"chars": 447,
"preview": "# Running Tests With Vagrant\n\nTo run tests using these instructions, you will first need to install\n[Vagrant](https://ww"
},
{
"path": "resources/vagrant/freebsd/README.md",
"chars": 201,
"preview": "# Run tests on FreeBSD\n\n``` bash\ncd /path/to/uuid/resources/vagrant/freebsd\nvagrant up\nvagrant ssh\n```\n\nOnce inside the "
},
{
"path": "resources/vagrant/freebsd/Vagrantfile",
"chars": 728,
"preview": "# -*- mode: ruby -*-\n# vi: set ft=ruby :\n\n$script = <<-SCRIPT\npkg update\npkg install -y \\\n php74 \\\n php74-bcmath \\\n p"
},
{
"path": "resources/vagrant/linux/README.md",
"chars": 197,
"preview": "# Run tests on Linux\n\n``` bash\ncd /path/to/uuid/resources/vagrant/linux\nvagrant up\nvagrant ssh\n```\n\nOnce inside the VM:\n"
},
{
"path": "resources/vagrant/linux/Vagrantfile",
"chars": 507,
"preview": "# -*- mode: ruby -*-\n# vi: set ft=ruby :\n\n$script = <<-SCRIPT\napt-get update\napt-get install -y \\\n composer \\\n php-bcm"
},
{
"path": "resources/vagrant/windows/README.md",
"chars": 211,
"preview": "# Run tests on Windows\n\n``` bash\ncd /path/to/uuid/resources/vagrant/windows\nvagrant up\nvagrant ssh\n```\n\nOnce inside the "
},
{
"path": "resources/vagrant/windows/Vagrantfile",
"chars": 892,
"preview": "# -*- mode: ruby -*-\n# vi: set ft=ruby :\n\n$script = <<-SCRIPT\nchoco install composer php unzip --no-progress -y\nInvoke-W"
},
{
"path": "src/BinaryUtils.php",
"chars": 1565,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Builder/BuilderCollection.php",
"chars": 2519,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Builder/DefaultUuidBuilder.php",
"chars": 569,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Builder/DegradedUuidBuilder.php",
"chars": 2053,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Builder/FallbackBuilder.php",
"chars": 1880,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Builder/UuidBuilderInterface.php",
"chars": 1016,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Codec/CodecInterface.php",
"chars": 2004,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Codec/GuidStringCodec.php",
"chars": 2104,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Codec/OrderedTimeCodec.php",
"chars": 3622,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Codec/StringCodec.php",
"chars": 3197,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Codec/TimestampFirstCombCodec.php",
"chars": 3355,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Codec/TimestampLastCombCodec.php",
"chars": 1551,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Converter/Number/BigNumberConverter.php",
"chars": 1237,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Converter/Number/DegradedNumberConverter.php",
"chars": 623,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Converter/Number/GenericNumberConverter.php",
"chars": 1194,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Converter/NumberConverterInterface.php",
"chars": 1482,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Converter/Time/BigNumberTimeConverter.php",
"chars": 1325,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Converter/Time/DegradedTimeConverter.php",
"chars": 616,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Converter/Time/GenericTimeConverter.php",
"chars": 4028,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Converter/Time/PhpTimeConverter.php",
"chars": 5784,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Converter/Time/UnixTimeConverter.php",
"chars": 2809,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Converter/TimeConverterInterface.php",
"chars": 1753,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/DegradedUuid.php",
"chars": 589,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/DeprecatedUuidInterface.php",
"chars": 5005,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/DeprecatedUuidMethodsTrait.php",
"chars": 13324,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Exception/BuilderNotFoundException.php",
"chars": 580,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Exception/DateTimeException.php",
"chars": 596,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Exception/DceSecurityException.php",
"chars": 608,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Exception/InvalidArgumentException.php",
"chars": 604,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Exception/InvalidBytesException.php",
"chars": 594,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Exception/InvalidUuidStringException.php",
"chars": 695,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Exception/NameException.php",
"chars": 598,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Exception/NodeException.php",
"chars": 595,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Exception/RandomSourceException.php",
"chars": 754,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Exception/TimeSourceException.php",
"chars": 580,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Exception/UnableToBuildUuidException.php",
"chars": 578,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Exception/UnsupportedOperationException.php",
"chars": 585,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Exception/UuidExceptionInterface.php",
"chars": 438,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/FeatureSet.php",
"chars": 12346,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Fields/FieldsInterface.php",
"chars": 753,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Fields/SerializableFieldsTrait.php",
"chars": 1903,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Generator/CombGenerator.php",
"chars": 3490,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Generator/DceSecurityGenerator.php",
"chars": 4327,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Generator/DceSecurityGeneratorInterface.php",
"chars": 1709,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Generator/DefaultNameGenerator.php",
"chars": 1111,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Generator/DefaultTimeGenerator.php",
"chars": 3733,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Generator/NameGeneratorFactory.php",
"chars": 695,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Generator/NameGeneratorInterface.php",
"chars": 1053,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Generator/PeclUuidNameGenerator.php",
"chars": 1468,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Generator/PeclUuidRandomGenerator.php",
"chars": 816,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Generator/PeclUuidTimeGenerator.php",
"chars": 879,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Generator/RandomBytesGenerator.php",
"chars": 1079,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Generator/RandomGeneratorFactory.php",
"chars": 705,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Generator/RandomGeneratorInterface.php",
"chars": 735,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Generator/RandomLibAdapter.php",
"chars": 1550,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Generator/TimeGeneratorFactory.php",
"chars": 1113,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Generator/TimeGeneratorInterface.php",
"chars": 1141,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Generator/UnixTimeGenerator.php",
"chars": 5975,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Guid/Fields.php",
"chars": 5002,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Guid/Guid.php",
"chars": 2275,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Guid/GuidBuilder.php",
"chars": 2297,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Lazy/LazyUuidFromString.php",
"chars": 13724,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Math/BrickMathCalculator.php",
"chars": 5058,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Math/CalculatorInterface.php",
"chars": 3854,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Math/RoundingMode.php",
"chars": 4909,
"preview": "<?php\n\n/**\n * This file was originally part of brick/math\n *\n * Copyright (c) 2013-present Benjamin Morel\n *\n * Permissi"
},
{
"path": "src/Nonstandard/Fields.php",
"chars": 3382,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Nonstandard/Uuid.php",
"chars": 979,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Nonstandard/UuidBuilder.php",
"chars": 2338,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Nonstandard/UuidV6.php",
"chars": 3469,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Provider/Dce/SystemDceSecurityProvider.php",
"chars": 6498,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Provider/DceSecurityProviderInterface.php",
"chars": 998,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Provider/Node/FallbackNodeProvider.php",
"chars": 1344,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Provider/Node/NodeProviderCollection.php",
"chars": 1904,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Provider/Node/RandomNodeProvider.php",
"chars": 1593,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Provider/Node/StaticNodeProvider.php",
"chars": 1791,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Provider/Node/SystemNodeProvider.php",
"chars": 4759,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Provider/NodeProviderInterface.php",
"chars": 652,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Provider/Time/FixedTimeProvider.php",
"chars": 1404,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Provider/Time/SystemTimeProvider.php",
"chars": 758,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Provider/TimeProviderInterface.php",
"chars": 566,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Rfc4122/Fields.php",
"chars": 5987,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Rfc4122/FieldsInterface.php",
"chars": 4308,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Rfc4122/MaxTrait.php",
"chars": 840,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Rfc4122/MaxUuid.php",
"chars": 645,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Rfc4122/NilTrait.php",
"chars": 788,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Rfc4122/NilUuid.php",
"chars": 644,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Rfc4122/TimeTrait.php",
"chars": 1397,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Rfc4122/UuidBuilder.php",
"chars": 5123,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Rfc4122/UuidInterface.php",
"chars": 643,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Rfc4122/UuidV1.php",
"chars": 2039,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Rfc4122/UuidV2.php",
"chars": 4304,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Rfc4122/UuidV3.php",
"chars": 2074,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Rfc4122/UuidV4.php",
"chars": 1967,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Rfc4122/UuidV5.php",
"chars": 2079,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Rfc4122/UuidV6.php",
"chars": 768,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Rfc4122/UuidV7.php",
"chars": 2040,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Rfc4122/UuidV8.php",
"chars": 2291,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Rfc4122/Validator.php",
"chars": 1335,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Rfc4122/VariantTrait.php",
"chars": 3069,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Rfc4122/VersionTrait.php",
"chars": 2232,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
},
{
"path": "src/Type/Decimal.php",
"chars": 3057,
"preview": "<?php\n\n/**\n * This file is part of the ramsey/uuid library\n *\n * For the full copyright and license information, please "
}
]
// ... and 87 more files (download for full content)
About this extraction
This page contains the full source code of the ramsey/uuid GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 287 files (1002.0 KB), approximately 274.8k tokens, and a symbol index with 1195 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.