sethajoh/ht_premis_uuid — pull request #1 by bryanesmith (2013-04-04 14:14:24+00:00)
Title: Reproducible UUIDs

Can specify timestamp (Time) as optional hash parameter, with test demonstrating reproducibility.

E.g.,
ns = 'namespace'
o_id = 'obj id'
p_e = 'premis event'
HtPremisUuid.generate(ns, o_id, p_e) # Will use Time.now by default
my_time Time.now # Or any arbitrary Time object
uuid_1 = HtPremisUuid.generate(ns, o_id, p_e, :time => my_time)
# ... later
uuid_2 = HtPremisUuid.generate(ns, o_id, p_e, :time => my_time)
puts uuid_1 == uuid_2
# true