made base32 code more generic