= 256) { throw new \Exception('Too much Excel column!'); } $keys = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; if ($index < 26) { return $keys[$index]; } else { $first = $index/26; $second = $index%26; return $keys[$first-1] . $keys[$second]; } } public static function generateUniqueCode(array $params, string $identity, $length = 8) { $md5Code = md5(microtime(true) . json_encode($params) . $identity . rand(0, 9999)); return substr($md5Code, 0, $length); } }