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

A lossless text compressor and encryptor using Bet Algo method.

example/bet_algo_example.dart

import 'package:bet_algo/bet_algo.dart';

void main() {
  // Make sure you have a .env file in your project root containing:
  // BET_ALGO_ENCRYPTION_KEY=YourSuperSecretKey123!

  final algo = BetAlgo.fromEnv();

  const text = '''
This is an example text to demonstrate BetAlgo compression and encryption.
It is not very repetitive but still will show the flow end-to-end.
''';

  print('Original text length: ${text.length}');

  final encrypted = algo.compressAndEncrypt(text);
  print('Encrypted compressed token length: ${encrypted.length}');
  print('Encrypted compressed token: $encrypted');

  final decompressed = algo.decryptAndDecompress(encrypted);
  print('Decompressed text length: ${decompressed.length}');
  print('Decompressed text: $decompressed');

  print('Match? ${text == decompressed ? "✅" : "❌"}');
}
0
likes
150
points
50
downloads

Publisher

unverified uploader

Weekly Downloads

A lossless text compressor and encryptor using Bet Algo method.

Homepage
Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

dotenv

More

Packages that depend on bet_algo