Sha256: 2e8ae170ec58d7277868f35140f15ee29229179b6fb0929397f184b8747f6c26

Contents?: true

Size: 306 Bytes

Versions: 2

Compression:

Stored size: 306 Bytes

Contents

# frozen_string_literal: true

module Lite
  module Uxid
    class Nanoid < Base::Irreversible

      def encode
        uxid = (0...coder_size).each_with_object(+"") do |i, str|
          str << coder_charset[coder_bytes[i] & 63]
        end

        "#{coder_prefix}#{uxid}"
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lite-uxid-1.5.1 lib/lite/uxid/nanoid.rb
lite-uxid-1.5.0 lib/lite/uxid/nanoid.rb