Closed juandiegocv27 closed 1 month ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
joyboy | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 28, 2024 2:12am |
joyboy-webapp | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 28, 2024 2:12am |
Optimized the Bech32 encoding implementation for better performance and efficiency:
-Constant ALPHABET: Defined ALPHABET as a global constant for Bech32 characters. -Memory Preallocation: Preallocated memory for the encoded result in the encode function. -Use of while Loops: Used while loops for controlled iteration in compliance with Cairo's constraints. -Optimized byte-to-5-bit Conversion: Improved convert_bytes_to_5bit_chunks function with more efficient bitwise -operations. -Optimized Checksum Calculation: Enhanced the checksum function for better array handling and efficiency.
These changes address the performance improvements requested in issue #74.
Before and After: -Function convert_bytes_to_5bit_chunks After:
Before:
![image](https://github.com/keep-starknet-strange/joyboy/assets/101369290/cdb9ba4a-ba4a-4de0-84c5-2f6e623f62c9)
Function encode After:
Before:
![image](https://github.com/keep-starknet-strange/joyboy/assets/101369290/f7ac0480-c475-4020-9dc5-a0ff2605d9a4)
Any suggestions are welcome, and I'm happy to make any changes you need. @maciejka @mubarak23