Don't allow data which is too long.
Now isolated for easy re-use. Should split it into a separate library.
Based on the Pi example