Skip to content

About tostring_int for bases other than 10 or 16 #18

@ghost

Description

Hi, @user-none
I've just known about your module and it works like a charm. However, I was intrigued by one aspect of the code:

ashex recurs to a local function tostring_int not accessible for the user, which in turns limits itself to base 10 and 16 (lines 602-604):

if base ~= 10 and base ~= 16 then
    return nil, "base not supported"
end

Is there a specific reason not to make base conversions accessible, e.g., via a new anumber:tobase(base).

Sorry if my question is a bit dumb. I'm not (hopefully still) very familiar to bitwise operations, so maybe I'm missing something from your code. Thank you in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions