You are here

function _multifield_generate_unique_id in Multifield 7.2

Same name and namespace in other branches
  1. 7 multifield.module \_multifield_generate_unique_id()

File

./multifield.module, line 478

Code

function _multifield_generate_unique_id() {
  $seen_ids =& drupal_static(__FUNCTION__, array());
  do {
    $id = mt_rand();
  } while (isset($seen_ids[$id]));
  $seen_ids[$id] = TRUE;
  return $id;
}