✨ Features: - App iOS completa para leer manga sin publicidad - Scraper con WKWebView para manhwaweb.com - Sistema de descargas offline - Lector con zoom y navegación - Favoritos y progreso de lectura - Compatible con iOS 15+ y Sideloadly/3uTools 📦 Contenido: - Backend Node.js con Puppeteer (opcional) - App iOS con SwiftUI - Scraper de capítulos e imágenes - Sistema de almacenamiento local - Testing completo - Documentación exhaustiva 🧪 Prueba: Capítulo 789 de One Piece descargado exitosamente - 21 páginas descargadas - 4.68 MB total - URLs verificadas y funcionales 🎉 Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
52 lines
1.0 KiB
JavaScript
52 lines
1.0 KiB
JavaScript
function byteLength(string) {
|
|
return string.length >>> 1
|
|
}
|
|
|
|
function toString(buffer) {
|
|
const len = buffer.byteLength
|
|
|
|
buffer = new DataView(buffer.buffer, buffer.byteOffset, len)
|
|
|
|
let result = ''
|
|
let i = 0
|
|
|
|
for (let n = len - (len % 4); i < n; i += 4) {
|
|
result += buffer.getUint32(i).toString(16).padStart(8, '0')
|
|
}
|
|
|
|
for (; i < len; i++) {
|
|
result += buffer.getUint8(i).toString(16).padStart(2, '0')
|
|
}
|
|
|
|
return result
|
|
}
|
|
|
|
function write(buffer, string) {
|
|
const len = buffer.byteLength
|
|
|
|
for (let i = 0; i < len; i++) {
|
|
const a = hexValue(string.charCodeAt(i * 2))
|
|
const b = hexValue(string.charCodeAt(i * 2 + 1))
|
|
|
|
if (a === undefined || b === undefined) {
|
|
return buffer.subarray(0, i)
|
|
}
|
|
|
|
buffer[i] = (a << 4) | b
|
|
}
|
|
|
|
return len
|
|
}
|
|
|
|
module.exports = {
|
|
byteLength,
|
|
toString,
|
|
write
|
|
}
|
|
|
|
function hexValue(char) {
|
|
if (char >= 0x30 && char <= 0x39) return char - 0x30
|
|
if (char >= 0x41 && char <= 0x46) return char - 0x41 + 10
|
|
if (char >= 0x61 && char <= 0x66) return char - 0x61 + 10
|
|
}
|