Setting dim to be the total length of dst + 1
Fixing return value of dim
Merge pull request #260 from eaescob/hexformat-fix

Setting dim to be the total length of dst + 1