summaryrefslogtreecommitdiff
path: root/src/Component.php
blob: 67cf96a76c20ee0bf64c37f7df95b8e2d2e1fdc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php

declare(strict_types=1);

namespace Zhineng\Snowflake;

interface Component
{
    /**
     * The bit size.
     */
    public function bits(): int;

    /**
     * The component value.
     */
    public function value(): int;

    /**
     * The maximum value based on the number of bits.
     */
    public function maxValue(): int;

    /**
     * Set the bit offset.
     */
    public function setOffset(int $offset): Component;

    /**
     * The bit offset.
     */
    public function offset(): int;
}