public static function generateRecoveryCodes($count = 1, $length = 9)
    {
        $count = intval($count);
        $length = intval($length);
        $codes = [];

        do {
            // Generate codes
            $code = '';
            for ($i = 1; $i <= $length; $i++) {
                $code .= random_int(0, 9);
            }

            // To make sure no duplicates get in
            if (!in_array($code, $codes)) {
                $codes[] = $code;
            }
        } while (count($codes) < $count);

        return $codes;
    }