Sha256: aab8de019832d1bb7a18671d18ade5d1b48c99dd541c4a9272f0c47c7c89dab8

Contents?: true

Size: 259 Bytes

Versions: 1

Compression:

Stored size: 259 Bytes

Contents

# -*- coding: utf-8 -*-
=begin rdoc
Please see README
=end

require 'securerandom'
require 'digest/sha2'

class XID < String

  def initialize(s=nil)
    super(s || SecureRandom.hex(16))
  end

  def digest
    Digest::SHA256.new.update(self).to_s
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sixarm_ruby_xid-3.2.0 lib/sixarm_ruby_xid.rb