export const PIN_MIN_LENGTH = 4;
export const PIN_MAX_LENGTH = 6;

export function sanitizePinInput(value: string, maxLength: number = PIN_MAX_LENGTH): string {
  return value.replace(/\D/g, '').slice(0, maxLength);
}

export function isPinInputComplete(value: string, minLength: number = PIN_MIN_LENGTH): boolean {
  return /^\d+$/.test(value) && value.length >= minLength && value.length <= PIN_MAX_LENGTH;
}
