continuation_token 2.0.0
continuation_token: ^2.0.0 copied to clipboard

Encode and decode continuation token values for stateless pagination APIs.

Encode and decode continuation token values for stateless pagination APIs.

Continuation data is a free-form Map that is:

  • encoded as JSON String
  • encoded as UTF-8 bytes
  • XOR-d with a given bytes of secret (optional)
  • encoded as BASE-64 String

Usage #

A simple usage example:

import 'package:continuation_token/continuation_token.dart';

main() {
  final codec = jsonMapContinuationCodec(secret: 'my-secret');

  final token = codec.encode({'id': 'abc123', 'asc': true});
  print(token); // FltEF0dZUAQWDkgfQEdPUAQHDlsXBxcWFxg

  final data = codec.decode(token);
  print(data); // {id: abc123, asc: true}
}
0
likes
110
pub points
0%
popularity

Encode and decode continuation token values for stateless pagination APIs.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD (LICENSE)

More

Packages that depend on continuation_token