add digits! function

Added a digits! function, with an optimization for the arguably common case of base = 2.