File: guid.rb

package info (click to toggle)
ruby-ffaker 2.25.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,852 kB
  • sloc: ruby: 13,136; makefile: 8; sh: 1
file content (18 lines) | stat: -rw-r--r-- 501 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

module FFaker
  module Guid
    extend ModuleUtils
    extend self

    # Because this method uses arbitrary hexadecimal characters it is likely to
    # generate invalid UUIDs--UUIDs must have a version (1-8) at bits 48-51,
    # and bits 64-65 must be 0b10.
    #
    # @deprecated Often generates invalid UUIDs. Use {UUID} instead.
    def guid
      warn '[guid] is deprecated. Use the UUID.uuidv4 method instead.'
      FFaker::UUID.uuidv4.upcase
    end
  end
end