()
| 3012 | } |
| 3013 | |
| 3014 | function readCryptoEstimateSpeed() { |
| 3015 | try { |
| 3016 | const raw = parseFloat(localStorage.getItem(CRYPTO_SPEED_STORAGE_KEY)); |
| 3017 | if (Number.isFinite(raw) && raw > 0) { |
| 3018 | return clampNum(raw, CRYPTO_MIN_SPEED_BPS, CRYPTO_MAX_SPEED_BPS); |
| 3019 | } |
| 3020 | } catch (e) { /* ignore */ } |
| 3021 | return CRYPTO_DEFAULT_SPEED_BPS; |
| 3022 | } |
| 3023 | |
| 3024 | function estimateCryptoProgress(totalBytes, doneBytes, elapsedMs) { |
| 3025 | if (!Number.isFinite(totalBytes) || totalBytes <= 0) return null; |
no test coverage detected