ElxValidation.Uuid (elx_validation v0.1.0)

uuid

  • The field under validation must be a valid RFC 4122 universally unique identifier (UUID).
data = %{
    uuid_1: "56b2724e-9074-4dc3-9803-4bb13c92ee0e",
    uuid_2: "56b2-9074-4dc3-9803-4bb13c9",   ---> not UUID
}

rules = [
    %{
      field: "uuid_1",
      validate: ["uuid"]
    },
   %{
      field: "uuid_2",
      validate: ["uuid"]
    },
  ]

Link to this section Summary

Functions

check target is uuid

Link to this section Functions

Link to this function

is_uuid(target)

check target is uuid

Link to this function

uuid_rfc_4122(target)

RFC 4122

  • 0-9 or a-f 8 char
  • 0-9 or a-f 4 char
  • 0-9 or a-f 4 char
  • 0-9 or a-f 4 char
  • 0-9 or a-f 12 char