Skip to content

HexSubjectIdGenerator ​

Rasuvaeff\Yii3AbTestingWeb\HexSubjectIdGenerator

Class · rasuvaeff/yii3-ab-testing-web · Source · implements SubjectIdGeneratorInterface

Default generator: 32 lowercase hex characters over 128 random bits — the format ab_id cookies have always used, so it stays the default and existing visitors keep their variant.

The id is opaque and carries no personal data, which is why it is not a UUID: nothing about the visitor should be derivable from it.

Methods ​

generate() ​

php
generate(): string

isValid() ​

php
isValid(string $id): bool