mirror of
https://gitlab.com/veilid/veilid.git
synced 2024-10-01 01:26:08 -04:00
16 lines
336 B
Dart
16 lines
336 B
Dart
|
import 'dart:convert';
|
||
|
import 'dart:typed_data';
|
||
|
|
||
|
String base64UrlNoPadEncode(List<int> bytes) {
|
||
|
var x = base64Url.encode(bytes);
|
||
|
while (x.endsWith('=')) {
|
||
|
x = x.substring(0, x.length - 1);
|
||
|
}
|
||
|
return x;
|
||
|
}
|
||
|
|
||
|
Uint8List base64UrlNoPadDecode(String source) {
|
||
|
source = base64.normalize(source);
|
||
|
return base64.decode(source);
|
||
|
}
|