public HttpMarvelApi(HttpClient client, IOptions <MarvelApiOptions> options, ILogger <HttpMarvelApi> logger) { _client = client ?? throw new ArgumentNullException(nameof(client)); _marvelApiOptions = options?.Value ?? throw new ArgumentNullException(nameof(options)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _client.BaseAddress = new Uri(_marvelApiOptions.Uri); }
string GetAuthorizationString(MarvelApiOptions marvelApiOptions, int ts = 0) { var hash = ComputeHash($"{ts}{marvelApiOptions.PrivateKey}{marvelApiOptions.PublicKey}"); return($"ts={ts}&apikey={marvelApiOptions.PublicKey}&hash={hash}"); }