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

A protobuf based, performant and lightweight token authentication package.

example/README.md

Example #

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
pub points
0%
popularity

Publisher

verified publisheryakforward.com

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