entropy 1.0.1 copy "entropy: ^1.0.1" to clipboard
entropy: ^1.0.1 copied to clipboard

Dart 1 only

An entropy calculator in Dart.

Entropy #

An entropy calculator in Dart.

Installation #

Add as a dependency to your pubspec.yaml. For example:

dependencies:
  entropy:
    git: git://github.com/kaisellgren/entropy.git

Later on it will be available on the official pub repository.

Example #

import 'package:entropy/entropy.dart';

void main() {
  var data = "The quick brown fox jumps over the lazy dog.";

  print(Entropy.calculate(data)); // 4.4877296299517635 bits of entropy.
}

Optimal is 8-bits of entropy per byte.

Use scenarios #

This can be used for various purposes including:

  • Finding out if a file is compressible. A low entropy level hints that compressing the file yields barely any improvement on size.
  • Determining strength of a password to a certain extent.

License #

The library is licensed under MIT. Feel free to use it for any purpose.

0
likes
10
points
36
downloads

Publisher

unverified uploader

Weekly Downloads

An entropy calculator in Dart.

View/report issues

License

MIT (license)

Dependencies

unittest

More

Packages that depend on entropy