Encode and Decode Strings in Python :
Encode converts a string to bytes, and decode converts bytes back to a string.
#Python #Encoding #Decoding #PythonTips #ByteString
Encode and Decode Strings in Python :
Encode converts a string to bytes, and decode converts bytes back to a string.
#Python #Encoding #Decoding #PythonTips #ByteString
Optimized the living crap out of Playdate MOD player's loading and resampling last night.
E.g.
Allocating table size in the ctor is snappy
```lua
local bytes = { string.byte(byteString, 1, #byteString) }
```
Locals are faster than var references
```lua
local sinc = _modplayer.constants.sinc
```
You can store a short sorted list in an integer. Yay math!
```lua
-- Make room for new blep
-- Store new blep level, age is always 0
bleps = (bleps << 16) + ((sampleIn - currentLevel) << 8)
```