3 namespace MediaWiki\User\TempUser
;
6 * Simple serial mapping for ASCII decimal numbers with hyphens for readability
10 class ReadableNumericSerialMapping
implements SerialMapping
{
14 * @param array $config
16 public function __construct( $config ) {
17 $this->offset
= $config['offset'] ??
0;
20 public function getSerialIdForIndex( int $index ): string {
21 $mapped = (string)( $index +
$this->offset
);
22 return rtrim( chunk_split( $mapped, 5, '-' ), '-' );