Created
December 11, 2018 23:00
-
-
Save rtorresve/f011a41a513e12f3c31e2e39970000f0 to your computer and use it in GitHub Desktop.
Hash Id decrypt implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# using hashids-1.2.0 and python 2.7.* | |
from hashids import Hashids | |
hashids = Hashids("S4mpl3 H4sh", 16, "abcdefABCDEF1234567890") | |
download_token = '4061c00d07f7526356bb170233e229499df81fDc516c8de204' | |
sample = dict() | |
values = hashids.decode(download_token[32:]) | |
sample['plateId'] = values[0] | |
sample['sequencing_row'] = chr(values[1]) | |
sample['sequencing_col'] = values[2] | |
sample['seqrun'] = values[3] | |
sample['ssr'] = values[4] | |
print sample |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment