From: Jan Friedrich Date: 2008-11-12T23:47:28+09:00 Subject: Re: Convert text string i.e 'Peter' into integer ID Justus Ohlhaver wrote: > Hugh Sasse wrote: > Thanks for your help. No I need to turn the string which would usually > be a headline ('Man lands on the moon') into a unique number. The > purpose is to speed up my database queries when checking whether an > entry with the same headline already exists in the db. Justus I would do something like this with a md5 hash: require 'digest/md5' Digest::MD5.hexdigest('Peter') # => "6fa95b1427af77b3d769ae9cb853382f" Regards Jan