String representation of a hexdecimal-encoded byte array.
A forward range of bytes.
import std.range.primitives : ElementType, isForwardRange; import std.traits : ReturnType; // The decoder implements a forward range. static assert(isForwardRange!(ReturnType!(fromHexStringAsRange!string))); static assert(isForwardRange!(ReturnType!(fromHexStringAsRange!wstring))); static assert(isForwardRange!(ReturnType!(fromHexStringAsRange!dstring))); // The element type of the range is always `ubyte`. static assert( is(ElementType!(ReturnType!(fromHexStringAsRange!string)) == ubyte) ); static assert( is(ElementType!(ReturnType!(fromHexStringAsRange!wstring)) == ubyte) ); static assert( is(ElementType!(ReturnType!(fromHexStringAsRange!dstring)) == ubyte) );
Converts a hex text string to a range of bytes.
The input to this function MUST be valid. std.digest.isHexString can be used to check for this if needed.