app/controllers/anoubis/core/application_controller.rb
##
# Decodes binary UUID data into the UUID string
# @param data [Binary] binary representation of UUID
# @return [String, nil] string representation of UUID or nil if can't be decoded
Decodes binary UUID data into the UUID string
Decodes binary UUID data into the UUID string
def bin_to_uuid(data)
    begin
      data = data.unpack('H*')[0]
      return data[0..7]+'-'+data[8..11]+'-'+data[12..15]+'-'+data[16..19]+'-'+data[20..31]
    rescue
      return nil
    end
  end
def bin_to_uuid ( data ) begin data = data . unpack ( 'H*' ) [ 0 ] return data [ 0 .. 7 ] + '-' + data [ 8 .. 11 ] + '-' + data [ 12 .. 15 ] + '-' + data [ 16 .. 19 ] + '-' + data [ 20 .. 31 ] rescue return nil end end
Decodes binary UUID data into the UUID string
Decodes binary UUID data into the UUID string
string representation of UUID or nil if can't be decoded
string representation of UUID or nil if can ' t be decoded
String, nil
data
binary representation of UUID
binary representation of UUID