encrypt_password (PGconn)

    /*
     * call-seq:
     *    PGconn.encrypt_password( password, username ) -> String
     *
     * This function is intended to be used by client applications that
     * send commands like: +ALTER USER joe PASSWORD 'pwd'+.
     * The arguments are the cleartext password, and the SQL name
     * of the user it is for.
     *
     * Return value is the encrypted password.
     */
    static VALUE
    pgconn_s_encrypt_password(VALUE self, VALUE password, VALUE username)
    {
            char *ret;
            Check_Type(password, T_STRING);
            Check_Type(username, T_STRING);
            ret = PQencryptPassword(StringValuePtr(password),
                    StringValuePtr(username));
            return rb_tainted_str_new2(ret);
    }