add hash length calculation method