Skip to content

rewrite bytes2hex to be more efficient #14341

@StefanKarpinski

Description

@StefanKarpinski

I was being really lazy when I wrote this one-liner:

bytes2hex(arr::Vector{UInt8}) = join([hex(i,2) for i in arr])

It's a good intro issue to rewrite this to pre-allocate a byte buffer, go through and fill it with hex characters appropriately and then return that buffer wrapped in a string object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIndicates a good issue for first-time contributors to JuliaperformanceMust go faster

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions