You are here

function role_export_generate_id in Role Export 6

Same name and namespace in other branches
  1. 7 role_export.module \role_export_generate_id()

Generates a numeric id from a machine name.

2 calls to role_export_generate_id()
role_export_normalize in ./role_export.module
Ensure that all rids are hashes of their machine_name.
role_export_submit in ./role_export.module
Save the role information to the {role} table.

File

./role_export.module, line 154
Role Export's primary module file.

Code

function role_export_generate_id($mname) {
  $hash = md5($mname);

  // Use the last 8 hex digits from the hash.
  $shorter = substr($hash, -8);
  $number = hexdec($shorter);
  return (int) $number;
}