module MIME::ID

Public Class Methods

generate_gid(domain = nil) click to toggle source

Generate global ID for “Message-ID” or “Content-ID” header.

# File lib/mime.rb, line 40
def self.generate_gid domain = nil
  generate_id + "@" + (domain || "#{generate_id}.local")
end
generate_id() click to toggle source

Generate local ID.

# File lib/mime.rb, line 30
def self.generate_id
  timestamp = (Time.now.to_f * 1E7).to_i
  rand(1E9).to_s(36) +
  object_id.to_s(36) +
  timestamp.to_s(36)
end