Skip to content

Releases: Geod24/bitblob

v2.3.0: Proper hex check in fromString, `-preview=in` change

08 Dec 23:01
Compare
Choose a tag to compare

This new release comes with two minor changes:

  • fromString will now properly check for hex characters, not just ASCII;
    This prevent a potential DoS when used with Vibe.d (user input could trigger an assert otherwise).
  • toString sink overload now takes its argument via in (as opposed to scope const as previously);

The latter change only impact users who use -preview=in.

v2.2.0: Improved `fromString` to acccept user input

08 Apr 00:21
Compare
Choose a tag to compare

The expectation around fromString has now been cleared up,
and until the constructor, it should accept user input and provide
and informative error message on failure.

v2.1.0: Support for format string

16 Mar 07:15
Compare
Choose a tag to compare

Support for format-like format string has been implemented.
The default, %s, will still lead to toString formatting things the same way,
namely the value BitBlob!1(42) will format as 0x2a.
Using %x will format as 2a, %X will format as %X and all other formats
will be interpreted as %s.

v2.0.0: Template argument to BitBlob changed from bits to bytes

12 Mar 15:10
Compare
Choose a tag to compare

BitBlob previous accepted a number of bits as argument.
However, it didn't support operations at the bit level,
and expected that amount to be a multiple of 8.
As most user code had to use * 8 with the argument,
this release just changes it to bytes.

v1.1.4: Support rvalue in opCmp

30 Aug 03:15
Compare
Choose a tag to compare

This release adds an opCmp overload that supports rvalue.

v1.1.3: Make string parsing CTFEable

22 Aug 03:52
Compare
Choose a tag to compare

The following code now compiles successfully:

static immutable BitBlob!256 AtCTFE = BitBlob!256(`0x....`);

Before it was erroring out due to enumerate not being CTFEable.

v1.1.2: Added/improved message on assert errors

05 Jul 09:07
Compare
Choose a tag to compare

While assert are not part of the package's interface,
they tend to trigger during development.
Confusing or absent message can confuse developers,
so Bitblob will now show those better error messages on assert error.

When calling this(scope const ubyte[] binary, bool isLittleEnding = false):

ubyte[] argument to BitBlob!256LU constructor does not match the expected size of 32LU

When calling this(scope const(char)[] hexstring):

Length of string passed to BitBlob!256LU constructor does not match the expected size of 32LU

v1.1.1: Correct string length check, reduce dependencies

23 May 02:51
Compare
Choose a tag to compare

Bitblob previously had a module-level dependency on std.algorithm.
Nowadays it only imports 2 functions from std.algorithm.searching.

v1.1.0: Improve documentation, usability, tests

15 Jan 05:45
Compare
Choose a tag to compare

As seen in the sole commit of this release:

This commit introduce a lot more documentation (README, inline) in preparation for Bitblob's release.
On the functional side, it also adds an opSlice overload, make the existing opIndex overload inout,
remove the dependency on std.format, and add tests that we indeed do not allocate when using
formattedWrite.

Initial release

07 Dec 11:17
Compare
Choose a tag to compare

BitBlob exposes a simple way to have nothrow/nogc, yet practical hash type.
It can be initialized from an hex string, and formatted to an hex string,
without needing allocation.