Sha256: d0fdfae57f672e252a48315ee8310c7324181d372eb11762ce507f10e3cf947b

Contents?: true

Size: 260 Bytes

Versions: 1

Compression:

Stored size: 260 Bytes

Contents

require 'securerandom'

module Kamerling
  module UUID
    module_function

    def [](bin)
      bin.unpack('H8H4H4H4H12').join('-')
    end

    def bin(uuid)
      [uuid.tr('-', '')].pack('H*')
    end

    def new
      SecureRandom.uuid
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kamerling-0.0.3 lib/kamerling/uuid.rb