{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "04737bf1-7447-464a-a24a-5ecbbd0b2dcf",
   "metadata": {},
   "outputs": [],
   "source": [
    "# default_exp utils"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "edc961d3-a1cc-449c-bdd3-1943f5f7f32e",
   "metadata": {},
   "source": [
    "## Utils module"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "096027ba-73f8-435a-820f-f48ea53aa1e9",
   "metadata": {},
   "outputs": [],
   "source": [
    "#export\n",
    "from xxhash import xxh32 as xxh"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6996c8fc-0095-41ec-a869-d6d156b6eaee",
   "metadata": {},
   "outputs": [],
   "source": [
    "#export\n",
    "def shorten_id(x):\n",
    "    return x if len(x) < 30 else f\"{x.split('_')[0]}_{xxh(x).hexdigest()}\""
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
