Sha256: 0a92c4c797177d833b64cb0e379ea55433103a6f5dbcb7fa8af9a166703ab823

Contents?: true

Size: 222 Bytes

Versions: 24

Compression:

Stored size: 222 Bytes

Contents

require "digest/md5"

class String
  def crc32
    Zlib.crc32(self)
  end

  def md5
    Digest::MD5.hexdigest(self)
  end

  # return a 64 bit uid
  def uid64
    md5.unpack("LL").inject { |a,b| (a << 31) + b }
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
radiospiel-app-0.2.3 lib/core-extensions/uids.rb
radiospiel-app-0.2.2 lib/core-extensions/uids.rb
radiospiel-app-0.2.1 lib/core-extensions/uids.rb
radiospiel-app-0.2.0 lib/core-extensions/uids.rb