Library: hashids

From Yombo
Jump to: navigation, search
hashids
Commonly Used No
Status Active

Summary
A simple way to represent a large number as a hash.

Introduction

Hashids library generates short, unique, non-sequential ids from numbers. It converts numbers like 187 into strings like “sa1”, or array of numbers like [67, 86] into “5Ptki”.


Hooks

No hooks registered.

Usage

Simply use the magic library reference to the _Hashids. See example below.

Examples

hash_int = self._Hashids.decode('abc123')  # decodes this string to an int.
hash_string = self._Hashids.encode(12)  # encodes this int to a string.


This page was last edited on 28 March 2018.