#!/usr/bin/python

import subprocess
import hashlib
import random

proc = subprocess.Popen(['dd', 'if=/dev/urandom', 'bs=1k', 'count=1'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = proc.communicate()
proc.wait()

hash   = hashlib.sha256(stdout).hexdigest()
length = random.randint(12, 18)
print hash[:length]

