Skip to content

Tags: Geod24/bitblob

Tags

v2.3.0

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

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

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

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

v2.1.0: Support for format string

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

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

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

v1.1.4: Support rvalue in opCmp

This release adds an `opCmp` overload that supports rvalue.

v1.1.3

v1.1.3: Make string parsing CTFEable

The following code now compiles successfully:
```d
static immutable BitBlob!256 AtCTFE = BitBlob!256(`0x....`);
```
Before it was erroring out due to `enumerate` not being CTFEable.

v1.1.2

v1.1.2: Added/improved message on assert errors

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

v1.1.1: Correct string length check, reduce dependencies

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

v1.1.0

v1.1.0: Improve documentation, usability, tests

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.
```

v1.0.0

BitBlob v1.0.0

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.