示例#1
0
        static void Main(string[] args)
        {
            Console.OutputEncoding = System.Text.Encoding.Unicode;

            int pin  = 1111;
            var hash = CalculateHashHelper.ComputeHash(pin.ToString());

            Console.WriteLine(hash.Length);
            Console.WriteLine(hash);
        }
示例#2
0
        public static BankCard CreateNewBankCard(Guid userId, Guid bankAccount)
        {
            var verificationCode = GenerateHelper.GenerateVerificationCode();
            var pinCode          = GenerateHelper.GeneratePinCode();

            return(new BankCard()
            {
                Id = Guid.NewGuid(),
                UserId = userId,
                BankAccountId = bankAccount,
                Number = GenerateHelper.GenerateCardNumber(),
                VerificationCode = CalculateHashHelper.ComputeHash(verificationCode.ToString()),
                PinCode = CalculateHashHelper.ComputeHash(pinCode.ToString()),
                Validity = DateTime.Now.AddYears(2),
                Active = true
            });
        }