byte_token 1.0.0+1 copy "byte_token: ^1.0.0+1" to clipboard
byte_token: ^1.0.0+1 copied to clipboard

outdated

A protobuf based, performant and lightweight token authentication package.

example/main.dart

import 'package:byte_token/byte_token.dart';

const aYear = Duration(days: 356);
final now = DateTime.now();

final signature = ByteSignature(
  Secret('eyJ1c2VySWQiOiJhYmNkMTIzIiwiZXhwaXJ5IjoxNjQ2NjM1NjExMzAx'),
);

final payload = Payload(
  email: 'user@gmail.com',
  emailVerified: true,
  issuedAt: now.millisecondsSinceEpoch,
  expirationTime: now.add(aYear).millisecondsSinceEpoch,
);

final token = ByteToken(
  payload: payload,
  signature: signature(payload),
);

final validator = ByteTokenValidator(signature);

final validTokenOrThrow = validator(token);
2
likes
0
points
17
downloads

Publisher

verified publisheryakforward.com

Weekly Downloads

A protobuf based, performant and lightweight token authentication package.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

crypto, fixnum, protobuf, yak_utils

More

Packages that depend on byte_token