|
Re: Primary Key Hash help: msg#01083lang.ruby.general
> > AL Prattville 36068 01001 US 01-001-0870 01 001 1 3 0162328 1 > > > > The unique key for each row is all columns. I'd like to generate a single > > column unique key that's derived from all the data, so a simple sequential > > number primary key won't do. Any tips on how I could do this in Ruby? > > Given > > row = line.split > > a unique key could be > > row.join True - but the result would be of varying length and a bit cumbersome. I was hoping for something along the lines of what Philipp replied with (MD5 hash). The MD5 hash is still a little cumbersome, but less than just joining all the data together. Thanks for the reply. Chris http://clabs.org
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Primary Key Hash help, Chris Morris |
|---|---|
| Next by Date: | Re: Primary Key Hash help, Michael Campbell |
| Previous by Thread: | Re: Primary Key Hash help, angus |
| Next by Thread: | Re: Primary Key Hash help, Dave Thomas |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |