MediaWiki master
ReadableNumericSerialMapping.php
Go to the documentation of this file.
1<?php
2
4
11 private int $offset;
12
16 public function __construct( $config ) {
17 $this->offset = $config['offset'] ?? 0;
18 }
19
20 public function getSerialIdForIndex( int $index ): string {
21 $mapped = (string)( $index + $this->offset );
22 return rtrim( chunk_split( $mapped, 5, '-' ), '-' );
23 }
24}
Simple serial mapping for ASCII decimal numbers with hyphens for readability.
Interface for integer to string mappings for temporary user autocreation.