Companion

Functions

Link copied to clipboard
fun restore(length: OtpLength, code: String, isError: Boolean): OtpState?

Rebuilds a numeric state from values saved earlier from length, code and isError, for example across Android configuration changes or process death, or iOS scene restoration.

fun restore(length: OtpLength, charset: OtpCharset, code: String, isError: Boolean): OtpState?

Rebuilds a state from values saved earlier from length, charset, code and isError, like the numeric overload. Returns null unless code holds only characters of charset (uppercase letters for OtpCharset.ALPHANUMERIC) and is no longer than length.