/* * Nextcloud - Android Client * * SPDX-FileCopyrightText: 2024 Your Name * SPDX-License-Identifier: AGPL-3.0-or-later */ package com.nextcloud.utils.extensions fun String.getRandomString(length: Int): String { val allowedChars = ('A'..'Z') + ('a'..'z') + ('0'..'9') val result = (1..length) .map { allowedChars.random() } .joinToString("") return this + result }