Number to byte array conversions for scripts