csrf-crypto.js
function getFormToken() {
		/*jshint validthis:true */
		if (this._csrfFormToken)
			return this._csrfFormToken;
		checkSecure(this.req);

		var cookieToken = getCookieToken(this) || createCookie(this);
		var salt = base64Random(saltSize);

		var hasher = crypto.createHmac(options.algorithm, formKey);
		hasher.update(cookieToken);
		hasher.update("|");
		hasher.update(salt);

		this._csrfFormToken = salt + "|" + hasher.digest('base64');
		return this._csrfFormToken;
	}
function getFormToken() {
		/*jshint validthis:true */
		if (this._csrfFormToken)
			return this._csrfFormToken;
		checkSecure(this.req);

		var cookieToken = getCookieToken(this) || createCookie(this);
		var salt = base64Random(saltSize);

		var hasher = crypto.createHmac(options.algorithm, formKey);
		hasher.update(cookieToken);
		hasher.update("|");
		hasher.update(salt);

		this._csrfFormToken = salt + "|" + hasher.digest('base64');
		return this._csrfFormToken;
	}
function getFormToken ( ) { /*jshint validthis:true */ if ( this . _csrfFormToken ) return this . _csrfFormToken ; checkSecure ( this . req ) ; var cookieToken = getCookieToken ( this ) || createCookie ( this ) ; var salt = base64Random ( saltSize ) ; var hasher = crypto . createHmac ( options . algorithm , formKey ) ; hasher . update ( cookieToken ) ; hasher . update ( "|" ) ; hasher . update ( salt ) ; this . _csrfFormToken = salt + "|" + hasher . digest ( 'base64' ) ; return this . _csrfFormToken ; }
Gets a new form token for the current response.
This function must be called on the response object.

@returns {String} An opaque token to include with new requests.
Gets a new form token for the current response . This function must be called on the response object .