(bytes)
| 210 | * @returns {string} Human-readable size string |
| 211 | */ |
| 212 | export function formatFileSize(bytes) { |
| 213 | if (bytes < 1024) return bytes + ' B'; |
| 214 | if (bytes < 1024 * 1024) return (bytes / 1024).toFixed(2) + ' KB'; |
| 215 | return (bytes / (1024 * 1024)).toFixed(2) + ' MB'; |
| 216 | } |
| 217 | |
| 218 | /** |
| 219 | * Calculate the SHA-256 hash of a file |
nothing calls this directly
no outgoing calls
no test coverage detected