Skip to content

Improve documentation of Extended Token features #10

Open
@dmohns

Description

@dmohns

As a user, it currently doesn't become very clear how the extended token features are used.

The code adds to the confusion with a lot of hardcoded values

    @classmethod
    def convert_hash_to_token(cls, this_hash):
        token = cls._convert_to_40_bits(
            this_hash
        )  # We convert the 64bits value to an INT no greater than 12 digits
        return token

    @classmethod
    def _convert_to_40_bits(cls, source):
        mask = ((1 << (64 - 24 + 1)) - 1) << 24
        temp = (source & mask) >> 24
        if temp > 999999999999:
            temp = temp - 99511627777
        return temp

The odd - 99511627777 seems very arbitrary.

Please, update the documentation to

  • Better reflect the relation between input token length (in chars) and the internal data storage type
  • Document whether this relation is completely dynamic (i.e. users can chose to have tokens of length 11) or if they have to pick from 10, 12 and 15

Please also update the code base in all languages to work with all supported modes. From a brief look

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions