From a75da5e54a91e5f80add1a660a532c068c5258f2 Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Sun, 13 Feb 2022 22:31:09 +0530 Subject: [PATCH] switch to base58 encoding for collectionKey in publicUrl --- lib/ui/share_collection_widget.dart | 5 ++--- pubspec.lock | 7 +++++++ pubspec.yaml | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/ui/share_collection_widget.dart b/lib/ui/share_collection_widget.dart index 1ff6ef724..5e513cc06 100644 --- a/lib/ui/share_collection_widget.dart +++ b/lib/ui/share_collection_widget.dart @@ -1,5 +1,6 @@ import 'dart:ui'; +import 'package:fast_base58/fast_base58.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_typeahead/flutter_typeahead.dart'; @@ -18,7 +19,6 @@ import 'package:photos/ui/loading_widget.dart'; import 'package:photos/ui/payment/subscription.dart'; import 'package:photos/utils/dialog_util.dart'; import 'package:photos/utils/email_util.dart'; -import 'package:photos/utils/hex.dart'; import 'package:photos/utils/share_util.dart'; import 'package:photos/utils/toast_util.dart'; @@ -210,8 +210,7 @@ class _SharingDialogState extends State { } Widget _getShareableUrlWidget() { - var hexEncoder = HexEncoder(upperCase: false); - String collectionKey = hexEncoder.convert( + String collectionKey = Base58Encode( CollectionsService.instance.getCollectionKey(widget.collection.id)); String url = "${widget.collection.publicURLs.first.url}#$collectionKey"; return SingleChildScrollView( diff --git a/pubspec.lock b/pubspec.lock index ebf280955..d16eef2e7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -274,6 +274,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" + fast_base58: + dependency: "direct main" + description: + name: fast_base58 + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.1" ffi: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 9ff7ed30f..4e7ea3c9d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -37,6 +37,7 @@ dependencies: exif: ^3.0.0 expansion_tile_card: ^2.0.0 extended_image: ^6.0.1 + fast_base58: ^0.2.1 firebase_core: ^1.10.0 firebase_messaging: ^11.1.0 flutter: