xxh3String function Buffer API

String xxh3String(
  1. Uint8List input, {
  2. Uint8List? secret,
  3. int seed = 0,
  4. HashLongFunction hashLongFunction = kXXH3HashLongFunction64Bit,
})

A convenience wrapper for xxh3 that returns the result, formatted as an unsigned hexadecimal string.

A typical usage example is as follows:

// Get some binary data (as a Uint8List)
final data = utf8.encode('Hello, world!');

// Use XXH3 to hash the byte array and get the
result as an unsigned hex value (returns a string).
final int digest = xxh3String(data);
print(digest); // f3c34bf11915e869

Implementation

String xxh3String(
  final Uint8List input, {
  final Uint8List? secret,
  final int seed = 0,
  final HashLongFunction hashLongFunction = kXXH3HashLongFunction64Bit,
}) =>
    BigInt.from(
      xxh3(
        input,
        secret: secret,
        seed: seed,
        hashLongFunction: hashLongFunction,
      ),
    ).toUnsigned(64).toRadixString(16);