4 ms·
Here's a very quick and dirty one for Ruby: require 'zlib' base = "whatever" salt = "whatever" Zlib.crc32(base + salt).to_s(36) This will generate 6-7 char
by compay 18y ago
Here's a very quick and dirty one for Ruby:
require 'zlib'
base = "whatever"
salt = "whatever"
Zlib.crc32(base + salt).to_s(36)
This will generate 6-7 character strings. Not sure how likely collisions are, but they should be rare enough that a simple check/regenerate should work.