How can I check that password is correct if I add random salt?

How can I check that password is correct if I add random salt?

I'm trying to secure my c# app. I know that we MUST store password hash and salt in DB. So my question:&nbsp;<strong>How I can compare that password is correct if I use Random salt?</strong>&nbsp;(Random salt gives random values each time). I also have the code below

I'm trying to secure my c# app. I know that we MUST store password hash and salt in DB. So my question: How I can compare that password is correct if I use Random salt? (Random salt gives random values each time). I also have the code below

 public static string HashPassword(string p, string s)
    {
        var combinedPassword = String.Concat(p, s);
        var sha256 = new SHA512Managed();
        var bytes = UTF8Encoding.UTF8.GetBytes(combinedPassword);
        var hash = sha256.ComputeHash(bytes);
        return Convert.ToBase64String(hash);
    }

public static String GetRandomSalt()
{
    var random = new RNGCryptoServiceProvider();
    var salt = new Byte[1024];
    random.GetBytes(salt);
    return Convert.ToBase64String(salt);
}

I am open to other suggestions in general.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

C/C++ vs. Rust: A developer’s perspective

In this post, you'll see the difference between Rust and C/C++ in a developer’s perspective

Variable Introduction in C#[Bangla]

LIKE | COMMENT | SHARE | SUBSCRIBE A variable is nothing but a name given to a storage area that our programs can manipulate. Each variable in C# has a speci...