phobos
phobos copied to clipboard
add std.conv.hexData()
This is an alternative to hexString
based on usage feedback from Dunnhumby.
- does not use templates so it does not have problems with very large strings nor object file bloat
-
wstring
anddstring
are not supported, as it is hard to imagine a compelling use case for them -
ubyte[]
is returned instead ofstring
as it only makes sense for hex data to initializeubyte
arrays, not strings - return value is
immutable
so it can be used to initialize global tables with need for casting - works with any string - no error cases. Non-hex digits are treated as separators
- it is intended to be used in CTFE code as a better replacement for the removed
x
string core language feature - it has no dependencies on anything else, and so can be cut-pasted into user code that does not rely on Phobos.
It is designed to work with https://github.com/dlang/DIPs/pull/177 although that is not required for hexData()
to be useful.
Thanks for your pull request, @WalterBright!
Bugzilla references
Your PR doesn't reference any Bugzilla issue.
If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.
Testing this PR locally
If you don't have a local development environment setup, you can use Digger to test this PR:
dub fetch digger
dub run digger -- build "master + phobos#7211"
The buildkite error is:
generated/linux/release/64/benchmark.o:benchmark/runbench.d:function _D3std5regex8internal9kickstart__T7ShiftOrTaZQl6__ctorMFNcNeKSQCiQChQCe2ir__T5RegexTaZQjAkZSQDmQDlQDiQDc__TQCvTaZQDb: error: undefined reference to '_D3std5range__T12assumeSortedVAyaa6_61203c3d2062TAkZQBlFNaNbNiNfQpZSQCoQCn__T11SortedRangeTQBqVQCna6_61203c3d2062ZQBl'
which has nothing to do with this PR.
Yeah the druntime benchmark check uses a wrong version of phobos.
@wilzbach so what's the fix?
Nothing, as Buildkite is not required to pass to pull. You should double-check that the benchmark is the only failure though.
@WalterBright a rebase will most likely fix the buildkite error and then the autotester will be green. However, you still need to address @CyberShadow 's review.