Nibbles
Companion object for Nibbles providing creation and manipulation methods.
Attributes
- Source
- Nibbles.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Nibbles.type
Members list
Type members
Types
Refinement constraint requiring the bit length to be a multiple of 4.
Refinement constraint requiring the bit length to be a multiple of 4.
Attributes
- Source
- Nibbles.scala
Value members
Concrete methods
Combines multiple Nibbles into one.
Combines multiple Nibbles into one.
Value parameters
- nibbles
-
sequence of Nibbles to combine
Attributes
- Returns
-
combined Nibbles
- Source
- Nibbles.scala
Concrete fields
Empty Nibbles value.
Givens
Givens
Decodes Nibbles from bytes.
Decodes Nibbles from bytes.
Decoding format: nibble count (BigNat) + nibble bytes
Attributes
- Source
- Nibbles.scala
Encodes Nibbles to bytes.
Encodes Nibbles to bytes.
Encoding format: nibble count (BigNat) + nibble bytes
Attributes
- Source
- Nibbles.scala
Cats Eq instance for Nibbles equality comparison.
Extensions
Extensions
Converts BitVector to Nibbles without validation.
Converts BitVector to Nibbles without validation.
Attributes
- Note
-
Throws runtime error if the constraint is not satisfied.
- Source
- Nibbles.scala
Converts BitVector to Nibbles with validation.
Converts BitVector to Nibbles with validation.
Attributes
- Returns
-
Right(Nibbles) on success, Left(error) on failure
- Source
- Nibbles.scala
Converts ByteVector to Nibbles.
Converts ByteVector to Nibbles.
Attributes
- Note
-
ByteVector always has a multiple of 8 bits, so conversion is safe.
- Source
- Nibbles.scala
Checks if this Nibbles is lexicographically less than that.
Checks if this Nibbles is lexicographically less than or equal to that.
Checks if this Nibbles is lexicographically less than or equal to that.
Attributes
- Source
- Nibbles.scala
Checks if this Nibbles is lexicographically greater than that.
Checks if this Nibbles is lexicographically greater than or equal to that.
Checks if this Nibbles is lexicographically greater than or equal to that.
Attributes
- Source
- Nibbles.scala
Converts to ByteVector.
Compares two Nibbles lexicographically.
Compares two Nibbles lexicographically.
Value parameters
- that
-
the Nibbles to compare with
Attributes
- Returns
-
negative (this < that), 0 (equal), positive (this > that)
- Source
- Nibbles.scala
Converts to hexadecimal string.
Returns the number of nibbles (bit size / 4).
Removes the given prefix if present.
Removes the given prefix if present.
Value parameters
- prefix
-
the prefix to remove
Attributes
- Returns
-
remainder after removing prefix, or None if prefix not found
- Source
- Nibbles.scala
Splits the first nibble and the remainder.
Splits the first nibble and the remainder.
Attributes
- Returns
-
first nibble value (0-15) and remaining Nibbles, or None if empty
- Source
- Nibbles.scala
Returns the underlying BitVector value.