ByteCollector class abstract

A container for digest bytes produced by a hash or encoding function.

It provides a rich set of methods to extract the underlying bytes as different encoded strings (hex, base32, base64, binary, octal), BigInt, numbers of arbitrary length, or decode them as ASCII or UTF-8.

It also features convenient equality checks and utilities for converting and comparing digests across representations.

Implementers

Constructors

ByteCollector()
Creates a new ByteCollector.
const

Properties

buffer → ByteBuffer
Returns the byte buffer associated with this digest.
no setter
bytes → Uint8List
The collected bytes.
no setter
hashCode → int
The hash code for this object.
no setteroverride
length → int
Returns the length of this digest in bytes.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

ascii() → String
The message digest as a string of ASCII alphabets.
base32({bool upper = true, bool padding = true}) → String
The message digest as a Base-32 string.
base64({bool urlSafe = false, bool padding = true}) → String
The message digest as a Base-64 string.
bigInt({Endian endian = Endian.little}) → BigInt
The message digest as a BigInt.
binary() → String
The message digest as a binary string.
hex([bool upper = false]) → String
The message digest as a hexadecimal string.
isEqual(Object? other) → bool
Checks if the message digest equals to other.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
number([int bitLength = 64, Endian endian = Endian.big]) → int
Gets an unsigned integer of bitLength-bit from the message digest.
octal() → String
The message digest as an octal string.
to(Encoding encoding) → String
Returns the digest in the given encoding
toString() → String
The message digest as a string of hexadecimal digits.
override
utf8() → String
The message digest as a string of UTF-8 alphabets.

Operators

operator ==(Object other) → bool
Two ByteCollector instances are equal if their bytes are equal.
override