Skip to content

Releases: Geod24/bitblob

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

Choose a tag to compare

@Geod24 Geod24 released this 08 Dec 23:01

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

Choose a tag to compare

@Geod24 Geod24 released this 08 Apr 00:21

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

Choose a tag to compare

@Geod24 Geod24 released this 16 Mar 07:15

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

Choose a tag to compare

@Geod24 Geod24 released this 12 Mar 15:10

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

Choose a tag to compare

@Geod24 Geod24 released this 30 Aug 03:15

This release adds an opCmp overload that supports rvalue.

v1.1.3: Make string parsing CTFEable

Choose a tag to compare

@Geod24 Geod24 released this 22 Aug 03:52

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

Choose a tag to compare

@Geod24 Geod24 released this 05 Jul 09:07

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

Choose a tag to compare

@Geod24 Geod24 released this 23 May 02:51

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

Choose a tag to compare

@Geod24 Geod24 released this 15 Jan 05:45

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

Choose a tag to compare

@Geod24 Geod24 released this 07 Dec 11:17

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.