Clipboard Otp Detector
class ClipboardOtpDetector
Detects OTP codes from clipboard text without polling.
Tracks the last clipboard snapshot and handled code so the same suggestion is not shown repeatedly until the clipboard content changes.
Functions
Link copied to clipboard
fun detect(clipboardText: String?, length: Int, allowedChars: OtpAllowedChars = OtpAllowedChars.DigitsOnly): String?
Returns a valid OTP extracted from clipboardText, or null when nothing should be suggested.
Link copied to clipboard
Call when the user applies or dismisses a suggestion so it is not shown again.