id) { return sha1('No address set'); } $uniqId = ''; try { $fields = $address->getFields(); } catch (Exception $e) { return sha1('Invalid address'); } foreach ($fields as $name => $value) { $uniqId .= $value . self::SEPARATOR; } $uniqId = rtrim($uniqId, self::SEPARATOR); return sha1($uniqId); } }