summaryrefslogtreecommitdiff
path: root/yarns/lib.py
diff options
context:
space:
mode:
Diffstat (limited to 'yarns/lib.py')
-rw-r--r--yarns/lib.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/yarns/lib.py b/yarns/lib.py
index cd95b6e..0914b00 100644
--- a/yarns/lib.py
+++ b/yarns/lib.py
@@ -13,6 +13,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import base64
import errno
import json
import os
@@ -218,3 +220,7 @@ def list_diff(a, b):
if delta:
return '\n'.join(delta)
return None
+
+
+def encode_basename(basename):
+ return base64.urlsafe_b64encode(basename.encode()).decode('ascii')