phobos/changelog/fromhexstring.dd
tynuk 23ea6b019d Add fromHexString, fromHexStringAsRange and isHexString
Squashed commit of the following:

commit af66b61a4ca4195c6b3a9de2a2eaaaa3786972c5
Author: Elias Batek
Date:   Sun Nov 3 09:37:51 2024 +0100

    Further cleanup

commit cb122cd54b14d253b29f99927b9f02cc4017dd05
Author: Elias Batek
Date:   Sun Nov 3 09:31:42 2024 +0100

    Add bloat because of questionable Circle CI failure

commit 1ad9e889bbe58ee9f0b5476f26b48aa7e51488d7
Author: Elias Batek
Date:   Sun Nov 3 09:24:37 2024 +0100

    Add cycle test

commit 913cfc771d694e785cae07157bccdf933fc8b969
Author: Elias Batek
Date:   Sun Nov 3 09:13:47 2024 +0100

    Split long lines

commit 4c062ccc07de668e75300ce3d20420b7dba51f15
Author: Elias Batek
Date:   Sun Nov 3 09:11:38 2024 +0100

    Do not leak implementation details in unittest

commit 66e64deecb2c3f9e4624204038ae0495a5d6f28a
Author: Elias Batek
Date:   Sun Nov 3 09:09:17 2024 +0100

    Improve unittests

commit 1b95777add501bd9ec21fcecf50be5de6fc182fb
Author: Elias Batek
Date:   Sun Nov 3 09:00:16 2024 +0100

    Fix style

commit b1e4c61440a11e4bc7481920a7ccf75065a5b5e9
Author: Elias Batek
Date:   Sun Nov 3 08:56:02 2024 +0100

    Improve unittests

commit c5aed51db374d6c4199f0ce9be1305d1b787248e
Author: Elias Batek
Date:   Sun Nov 3 08:31:57 2024 +0100

    Fix decoder regression

commit 89f4d9bf81bd4709b11e58f4caae782b5a63ff73
Author: Elias Batek
Date:   Sun Nov 3 08:21:52 2024 +0100

    Rename

commit c3a8c5263272770272e77fec30af3d2d833c41da
Author: Elias Batek
Date:   Sun Nov 3 08:11:03 2024 +0100

    Oops

commit aff5b0d8a38c33c94308618cf5aa7819a9427070
Author: Elias Batek
Date:   Sun Nov 3 08:03:32 2024 +0100

    Fix typo and wstring/dstring bug

commit dbe75e9a35b4d963ae7fc54dc69060ce0a59065a
Author: Elias Batek
Date:   Sun Nov 3 08:03:23 2024 +0100

    Improve docs

commit 9ff3ac3e43346e266e4fef51bd9d8e86f80dd48d
Author: Elias Batek
Date:   Sun Nov 3 07:50:35 2024 +0100

    Fix return type typo

commit 4b68416030f3c7782716964c276c9c99d1b08932
Author: Elias Batek
Date:   Sun Nov 3 07:49:48 2024 +0100

    Add validation

commit 3d2224478f4c20f252a409c37d755be05eb6f049
Author: Elias Batek
Date:   Sun Nov 3 07:34:21 2024 +0100

    Remove no longer necessary cast

commit a8ac073a6437dc3c7f079a9a9aa199dd6bd4e57d
Author: Elias Batek
Date:   Sun Nov 3 07:30:41 2024 +0100

    Improve docs

commit 4efb47b9b92ece256485c2d4d34c2a82133a2da3
Author: Elias Batek
Date:   Sun Nov 3 07:27:54 2024 +0100

    Cleanup API

commit d1a3fd0b466480d4f1ddddbd9f4437088a667a4b
Author: Elias Batek
Date:   Sun Nov 3 07:15:42 2024 +0100

    Add constraints

commit 5fb9097c548e5be25dcc45cfdbb7f29010143955
Author: Elias Batek
Date:   Sun Nov 3 07:05:17 2024 +0100

    Improve docs

commit 100aa5f996b088d7962891f3fd60a6e23d6c887b
Author: Elias Batek
Date:   Sun Nov 3 06:46:32 2024 +0100

    Refactor

commit 13551c1de0e54c19ec72bc0294f6956a7c787790
Author: Elias Batek
Date:   Sun Nov 3 06:37:33 2024 +0100

    Fix out-of-bounds bug

commit cca538ffef43894b607847473e56ab3af476660c
Author: Elias Batek
Date:   Sun Nov 3 06:32:52 2024 +0100

    Fix accidental conversion of faulty hex digits

commit c4a367ddbe334928d6c2ec7953ecab6bdbb6080f
Author: Elias Batek
Date:   Sun Nov 3 06:19:19 2024 +0100

    Refactor

commit 538ea2380c54e0eea08dc422766ebc3bad0bbb29
Author: Elias Batek
Date:   Sun Nov 3 06:15:21 2024 +0100

    Add changelog

commit cb1b131743a3b1f377f8740e5721eef1eda70d2d
Author: Elias Batek
Date:   Sun Nov 3 05:17:55 2024 +0100

    Add fromHexString

    Squashed commit of the following:

    commit bc159e9b44c89e68b66dfb3c54bd781229dffa46
    Author: Tynuk <bowsworddv@gmail.com>
    Date:   Sat Jan 27 12:14:52 2024 +0200

        update style

    commit 1fc719532fb83b764c95701973a5fddc98520a15
    Author: Tynuk <bowsworddv@gmail.com>
    Date:   Sat Jan 27 11:52:19 2024 +0200

        create ByteRange

    commit 27ea722f04d9b0120aff2a405935530dd0174950
    Author: Tynuk <43266276+Tynukua@users.noreply.github.com>
    Date:   Thu Aug 25 16:19:45 2022 +0300

        rm spaces

    commit 1fdf63ab4baafc1c4d6d9e957767fe64716365ef
    Author: Tynuk <43266276+Tynukua@users.noreply.github.com>
    Date:   Thu Aug 25 15:55:40 2022 +0300

        Rename

    commit 4b37b8d40d1c251b35e3c14ec64e3b15a388e158
    Author: Tynuk <43266276+Tynukua@users.noreply.github.com>
    Date:   Thu Aug 25 15:26:10 2022 +0300

        Update std/digest/package.d

    commit 712eb2504371c63bee582fb53b5d2bbae9e6f525
    Author: Tynuk <43266276+Tynukua@users.noreply.github.com>
    Date:   Thu Aug 25 15:25:51 2022 +0300

        Update std/digest/package.d

    commit 4826317a5d9d1da7ef8cd4b6df87237d8d254bff
    Author: Tynuk <43266276+Tynukua@users.noreply.github.com>
    Date:   Thu Aug 25 15:25:43 2022 +0300

        Update std/digest/package.d

    commit aedb66bd1ab8bdd1f5acc54f5f63f2c9d2b33b05
    Author: tynuk <bowsworddv@gmail.com>
    Date:   Mon Aug 8 15:15:42 2022 +0300

        add toDigest / hexToBytes

Co-authored-by: Elias Batek <desisma@heidel.beer>
2024-11-03 17:59:26 +08:00

15 lines
789 B
Text

Added fromHexString and fromHexStringAsRange functions to std.digest.
This new function enables the converion of a hex string to a range of bytes.
Unlike the template $(REF hexString, std, conv) that was designed to supersede
a language feature, this function is usable with runtime input.
The `std.conv` module lacks facilities to conveniently transform the input
to a series of bytes directly. Both $(REF parse, std, conv) and $(REF to, std,
conv) can only handle the conversion for a single value of the requested target
integer type. Furthermore, said functions would allocate a new buffer for the
result, while `fromHexStringAsRange` operates lazily by implementing a forward
range.
For further convenience, a validation function $(REF isHexString, std, digest)
was added as well.