Returns unique token for method and params
11420
public function getCsrfToken(string $control, string $method, array $params): string
	{
		return Helpers::getCsrfToken($this->getSession(), $control, $method, $params);
	}
1292979
def gen_request_parameters method, params
      #add common parameters
      params.merge! self.service.default_parameters

      params.merge! self.options

      params[:Action] = method.to_s
      params[:Timestamp] = Time.now.utc.iso8601
      params[:SignatureNonce] = SecureRandom.uuid
      params[:Signature] = compute_signature params

      params
    end
491982
private Implementation.SpecialMethodInvocation invokeMethod(MethodDescription.SignatureToken token) {
        MethodGraph.Node methodNode = methodGraph.getSuperClassGraph().locate(token);
        return methodNode.getSort().isUnique()
                ? Implementation.SpecialMethodInvocation.Simple.of(methodNode.getRepresentative(), instrumentedType.getSuperClass().asErasure())
                : Implementation.SpecialMethodInvocation.Illegal.INSTANCE;
    }
1099404
@Nonnull
    public String getTokenName(final int pTokenId)
    {
        final List<String> searchClasses = Arrays.asList("com.puppycrawl.tools.checkstyle.utils.TokenUtil",
            "com.puppycrawl.tools.checkstyle.utils.TokenUtils", TokenTypes.class.getName(),
            "com.puppycrawl.tools.checkstyle.Utils");
        Method getTokenName = null;

        for (final String className : searchClasses) {
            try {
                final Class<?> utilsClass = Class.forName(className);
                getTokenName = utilsClass.getMethod("getTokenName", int.class);
                break;
            }
            catch (ClassNotFoundException | NoSuchMethodException e) {
                // ignore
            }
        }
        if (getTokenName == null) {
            throw new UnsupportedOperationException("getTokenName() - method not found");
        }

        String result = null;
        try {
            result = (String) getTokenName.invoke(null, pTokenId);
        }
        catch (IllegalAccessException | InvocationTargetException e) {
            throw new UnsupportedOperationException(getTokenName.getDeclaringClass().getName() + ".getTokenName()", e);
        }
        return result;
    }
412742
def method_missing(sym, *args, &block)
      if self.internal_object.key?(sym.to_s)
        return self.internal_object[sym.to_s]
      end

      super
    end
1023018
function getTokenParameters(index) {
    let stringLength;
    let indexWithOffset;

    indexWithOffset = index;
    for (stringLength = startLength; stringLength <= endLength; stringLength += 1) {
      const offsetCount = variants.length ** stringLength;
      if (indexWithOffset < offsetCount) {
        break;
      } else {
        indexWithOffset -= offsetCount;
      }
    }

    return {
      indexWithOffset,
      stringLength,
    };
  }
894057
def encode_params(params)
      return params.map do |p|
        if p.is_a?(Integer)
          Util.int_to_hex(p)
        else
          p
        end
      end
    end
1317955
def get_objects(method, key)
      self.class.get("/#{method}", query: { token: @token }).tap do |response|
        raise "error retrieving #{key} from #{method}: #{response.fetch('error', 'unknown error')}" unless response['ok']
      end.fetch(key)
    end
599892
def to_hash
      action = @parameters[:action]
      userid = @parameters[:userid]
      appname = @parameters[:appname] || @appname
      patientid = @parameters[:patientid]
      token = @parameters[:token] || @security_token
      parameter1 = process_date(@parameters[:parameter1]) || ''
      parameter2 = process_date(@parameters[:parameter2]) || ''
      parameter3 = process_date(@parameters[:parameter3]) || ''
      parameter4 = process_date(@parameters[:parameter4]) || ''
      parameter5 = process_date(@parameters[:parameter5]) || ''
      parameter6 = process_date(@parameters[:parameter6]) || ''
      data = Utilities::encode_data(@parameters[:data]) || ''

      {
        'Action' => action,
        'AppUserID' => userid,
        'Appname' => appname,
        'PatientID' => patientid,
        'Token' => token,
        'Parameter1' => parameter1,
        'Parameter2' => parameter2,
        'Parameter3' => parameter3,
        'Parameter4' => parameter4,
        'Parameter5' => parameter5,
        'Parameter6' => parameter6,
        'Data' => data
      }
    end
1243928
private String makeSignature(ASTMethod method) {
        List<ASTType> paramTypes = new ArrayList<ASTType>();

        for (ASTParameter parameter : method.getParameters()) {
            paramTypes.add(parameter.getASTType());
        }

        return makeSignature(method.getName(), paramTypes);
    }
730603
def build_uri(method, params = {})
      uri = URI(api_server)
      uri.path  = '/api/' + method.sub('.', '/')
      uri.query = URI.encode_www_form(sign(params))

      SchoolFriend.logger.debug "API Request: #{uri}"

      uri
    end
488109
def callback(name, params, returns)
      params, returns = generate_signature(params, returns)
      super name.to_sym, params, returns
    end
1257874
private String _getUniqueKey()
	{
		StringBuilder b = new StringBuilder();
		b.append( service );
		b.append( "#" );
		b.append( method );
		if( params != null )
		{
			b.append( "#" );
			b.append( params.toString() );
		}

		return b.toString();
	}
1186426
def get_params(self, token_stack):
        """"""
        params = {}
        for token in token_stack:
            params.update(token.params)
        return params
528283
private String generateSafeMethodName(StorableInfo info, String prefix) {
        Class type = info.getStorableType();

        // Try a few times to generate a unique name. There's nothing special
        // about choosing 100 as the limit.
        int value = 0;
        for (int i = 0; i < 100; i++) {
            String name = prefix + value;
            if (!methodExists(type, name)) {
                return name;
            }
            value = name.hashCode();
        }

        throw new InternalError("Unable to create unique method name starting with: "
                + prefix);
    }
561832
def method_missing(key, *args, &block)
      if key.to_s =~ /\A(.+)=\z/
        self[$1] = args.first
        return args.first
      end
      if key.to_s =~ /\A(.+)\?\z/
        return !!self[$1]
      end
      return self[key]  if has_key?(key)
      nil
    end
1188816
public function getUniqueToken()
    {
        $tries = 0;
        $candidate = $this->cretateToken();
        // give up and throw an exception if it seems impossible to create a unique token
        while ($tries++ < 5 && in_array($candidate, $this->generated)) {
            $candidate = $this->cretateToken();
        }
        if (in_array($candidate, $this->generated)) {
            throw new \RuntimeException("failed to create a new unique token");
        }

        $this->generated[] = $candidate;

        return $candidate;
    }