b58encode: speedup.
Avoid exception on invalid script.