/// <summary> /// Prevents a default instance of the <see cref="IdHasher"/> class from being created. /// </summary> private IdHasher() { // Initialize the hasher with the encryption key trimmed down to an // acceptable length. The salt must be shorter than the length of // the available characters. var salt = ConfigurationManager.AppSettings["DataEncryptionKey"].Left(40); _hasher = new Hashids(salt, 10); }
public PileOperationsController(IPileCardsInterractor pileCardsInterractor, IMapper mapper, IDeckRepository deckRepository, IHashids hashids) { _pileCardsInterractor = pileCardsInterractor; _mapper = mapper; _deckRepository = deckRepository; _hashids = hashids; }
public static IServiceCollection AddHashids(this IServiceCollection services, Action<HashidsOptions> setup) { services.Configure(setup); services.AddSingleton(sp => sp.GetRequiredService<IOptions<HashidsOptions>>().Value); services.AddSingleton<IConfigureOptions<JsonOptions>, ConfigureJsonOptions>(); services.AddSingleton(sp => { var options = sp.GetRequiredService<HashidsOptions>(); Hashids = new Hashids(options.Salt, options.MinHashLength, options.Alphabet, options.Steps); return Hashids; }); services.PostConfigure<RouteOptions>(setup => { setup.ConstraintMap.Add("hashids", typeof(HashidsRouteConstraint)); }); return services; }
public DeckRepository(ILiteDbContext context, IHashids hashids) { db = context.Database; _hashids = hashids; }
public void Setup() { hashService = new Hashids("this is a test salt", 5); }
public RpgCharacterCombatController(IMediator mediator, IHashids hashids) { this.mediator = mediator; this.hashids = hashids; }
public HashIdGenerator(IHashids hashGenerator) { this.hashGenerator = hashGenerator; }
public HashidsRouteConstraint(IHashids hashids) { this.hashids = hashids ?? throw new ArgumentNullException(nameof(hashids)); }
public HashidsModelBinder(IHashids hashids) { this.hashids = hashids ?? throw new System.ArgumentNullException(nameof(hashids)); }
public PileCardsInterractor(IDeckRepository deckRepository, ICardsHelper cardsHelper, IHashids hashids) { _deckRepository = deckRepository; _cardsHelper = cardsHelper; _hashids = hashids; }
public RpgCharacterCombatControllerShould() { mediator = Substitute.For <IMediator>(); hashids = Substitute.For <IHashids>(); controller = new RpgCharacterCombatController(mediator, hashids); }
public ShortLinkService(IConfiguration configuration, IDataProvider dataProvider, IHashids hashids) { _configuration = configuration; _dataProvider = dataProvider; _hashids = hashids; }