smchash 0.1.1 copy "smchash: ^0.1.1" to clipboard
smchash: ^0.1.1 copied to clipboard

High-performance hash function passing all 188 SMHasher3 tests. Includes PRNG that passes BigCrush/PractRand.

example/smchash_example.dart

import 'dart:convert';
import 'package:smchash/smchash.dart';

void main() {
  // Basic hashing
  final data = utf8.encode('Hello, World!');
  final hash = smchash(data);
  print('smchash("Hello, World!") = 0x${hash.toRadixString(16)}');

  // Seeded hashing
  final seeded = smchashSeeded(data, 12345);
  print(
      'smchashSeeded("Hello, World!", 12345) = 0x${seeded.toRadixString(16)}');

  // PRNG
  final rng = SmcRandState(42);
  print('Random: ${rng.next()}, ${rng.next()}, ${rng.next()}');
}
0
likes
160
points
135
downloads

Publisher

verified publisherscalecode.dev

Weekly Downloads

High-performance hash function passing all 188 SMHasher3 tests. Includes PRNG that passes BigCrush/PractRand.

Repository (GitHub)
View/report issues

Topics

#hash #hashing #cryptography #random

Documentation

API reference

License

MIT (license)

More

Packages that depend on smchash