md5 here just because it's faster and generally safe if you don't have 
trillion records....
from hashlib import md5
compute=lambda r: md5(str(r)).hexdigest()

On Tuesday, March 5, 2013 10:54:21 PM UTC+1, Alec Taylor wrote:
>
> What's the DAL syntax for computing a unique hash for each tuple/row? 
>
> (so that no other tuple/row has that same hash) 
>
> What I have tried: 
>
> Field('my_field_name', unique=True, compute=lambda q: 
> CRYPT(digest_alg='sha1',key='my_field_name',salt=True)(str(q)).split('$')[0]),
>  
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to