Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Py_hexdigits constant: use one unique constant to format a digit to hexadecimal #57297

Closed
vstinner opened this issue Oct 1, 2011 · 4 comments
Assignees

Comments

@vstinner
Copy link
Member

vstinner commented Oct 1, 2011

BPO 13088
Nosy @pitrou, @vstinner
Files
  • hexdigits.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/vstinner'
    closed_at = <Date 2011-10-16.20:13:04.605>
    created_at = <Date 2011-10-01.23:32:56.518>
    labels = []
    title = 'Add Py_hexdigits constant: use one unique constant to format a digit to hexadecimal'
    updated_at = <Date 2011-10-16.20:13:04.603>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2011-10-16.20:13:04.603>
    actor = 'vstinner'
    assignee = 'vstinner'
    closed = True
    closed_date = <Date 2011-10-16.20:13:04.605>
    closer = 'vstinner'
    components = []
    creation = <Date 2011-10-01.23:32:56.518>
    creator = 'vstinner'
    dependencies = []
    files = ['23288']
    hgrepos = []
    issue_num = 13088
    keywords = ['patch']
    message_count = 4.0
    messages = ['144754', '145489', '145591', '145637']
    nosy_count = 3.0
    nosy_names = ['pitrou', 'vstinner', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue13088'
    versions = ['Python 3.3']

    @vstinner
    Copy link
    Member Author

    vstinner commented Oct 1, 2011

    CPython source code contains a lot of duplicate "0123456789abcdef" constants, declared as static variables. Attached patch uses one unique variable. Use also Py_hexdigit instead of ((c>9) ? c+'a'-10 : c + '0') in binascii, _hashopenssl, md5, sha1, sha256 and sha512 modules.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 14, 2011

    New changeset d76338eacf7c by Victor Stinner in branch 'default':
    Issue bpo-13088: Add shared Py_hexdigits constant to format a number into base 16
    http://hg.python.org/cpython/rev/d76338eacf7c

    @pitrou
    Copy link
    Member

    pitrou commented Oct 15, 2011

    You broke compilation under Windows.

    @vstinner
    Copy link
    Member Author

    Antoine fixed the compilation issue.

    http://hg.python.org/cpython/rev/c63087ac1f6c
    changeset: 72941:c63087ac1f6c
    user: Antoine Pitrou <solipsis@pitrou.net>
    date: Sat Oct 15 16:38:20 2011 +0200

    Fix build under Windows

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants