Add encode for Numbin class