bsdiff 0.1.0 copy "bsdiff: ^0.1.0" to clipboard
bsdiff: ^0.1.0 copied to clipboard

discontinued

Binary diff/patch algorithm based on bsdiff by Colin Percival.

example/main.dart

// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Example script to illustrate how to use the bsdiff package to generate and apply patches.

import 'dart:typed_data';

import 'package:bsdiff/bsdiff.dart';

void main() async {
  final Uint8List originalData = Uint8List.fromList(List.generate(1000, (index) => index));
  final Uint8List modifiedData = Uint8List.fromList(List.generate(2000, (index) => 2 * index));

  print('Original data size ${originalData.length} bytes');
  print('Modified data size ${modifiedData.length} bytes');

  final Uint8List generatedPatch = bsdiff(originalData, modifiedData);
  final Uint8List restoredData = bspatch(originalData, generatedPatch);

  print('Generated patch is ${generatedPatch.length} bytes');
  print('Restored data size ${restoredData.length} bytes');
}
3
likes
15
points
43
downloads

Publisher

verified publisherflutter.dev

Weekly Downloads

Binary diff/patch algorithm based on bsdiff by Colin Percival.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on bsdiff