def add(username, password, algorithm = Algorithm::DEFAULT)
      raise PasswdFileError, "Unable to add already existing user #{username}" if has_entry?(username)
      new_entry = PasswdEntry.new(username, password, algorithm)
      new_index = @lines.size
      @lines << new_entry.to_s
      @entries[new_entry.key] = { 'entry' => new_entry, 'line_index' => new_index }
      dirty!
      return nil
    end
def add(username, password, algorithm = Algorithm::DEFAULT)
      raise PasswdFileError, "Unable to add already existing user #{username}" if has_entry?(username)
      new_entry = PasswdEntry.new(username, password, algorithm)
      new_index = @lines.size
      @lines << new_entry.to_s
      @entries[new_entry.key] = { 'entry' => new_entry, 'line_index' => new_index }
      dirty!
      return nil
    end
Public: Add a new record to the file.

 username  - the username of the entry
 password  - the username of the entry
 algorithm - the algorithm to use (default: "md5"). Valid options are:
             "md5", "sha1", "plaintext", or "crypt"

 Examples

   passwd_file.add("newuser", "password")
   passwd_file.save!

   passwd_file.add("newuser", "password", "sha1")
   passwd_file.save!

 Returns nothing.
 Raises PasswdFileError if the give username already exists.