Advanced Interop - Text Encoder
This example demonstrates advanced PyScript interoperability...
π Available Encodings
- MD5 Hash - 128-bit cryptographic hash
- SHA-1 Hash - 160-bit cryptographic hash
- SHA-256 Hash - 256-bit secure cryptographic hash
- Base64 - Binary-to-text encoding
- ROT13 Cipher - Simple letter substitution cipher
π‘ Why Python?
These operations are trivial in Python thanks to built-in libraries:
hashlib- Cryptographic hashingbase64- Base64 encoding/decodingcodecs- Text encoding transformations
In JavaScript, you would need...
π What's New: PyScriptManager
This example uses the new PyScriptManager system:
- Event-driven - No polling
- Instant readiness - Python signals when ready
- Error handling - Captures errors
- Multiple exports - 6 functions loaded
Check the browser console...
ποΈ Architecture
Clean separation of concerns:
- Python - Uses PyScriptManager
- Controller - Manages lifecycle
- Svelte - Pure UI rendering