Skip to content

Instantly share code, notes, and snippets.

@hxalid
Created January 22, 2019 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hxalid/f630948b5aa33429e88868fc726e2c0a to your computer and use it in GitHub Desktop.
Save hxalid/f630948b5aa33429e88868fc726e2c0a to your computer and use it in GitHub Desktop.
public static class bcrypt
{
[FunctionName("bcrypt")]
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
ILogger log)
{
string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
var hashedPassword = BCrypt.Net.BCrypt.HashPassword(requestBody);
return (ActionResult)new OkObjectResult(hashedPassword);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment