bet_algo 1.0.1
bet_algo: ^1.0.1 copied to clipboard
A lossless text compressor and encryptor using Bet Algo method.
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 ? "✅" : "❌"}');
}