Skip to content

Commit

Permalink
Merge pull request #2 from dlmelendez/rel/v1.0
Browse files Browse the repository at this point in the history
Rel/v1.0 prepare for 1.0 release
  • Loading branch information
dlmelendez committed Apr 29, 2017
2 parents a8851f6 + 56789f5 commit ca3f68a
Show file tree
Hide file tree
Showing 6 changed files with 323 additions and 187 deletions.
Binary file modified sample/.vs/samplecore.sqlite
Binary file not shown.
2 changes: 1 addition & 1 deletion sample/samplecore.mvc/samplecore.mvc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<UserSecretsId>aspnet-samplecore.mvc-7879744d-6d27-4ada-8655-fd6e1ee429b5</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ElCamino.AspNetCore.Identity.DocumentDB" Version="0.9.2" />
<PackageReference Include="ElCamino.AspNetCore.Identity.DocumentDB" Version="1.0.0" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="1.1.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,20 @@
<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<PackageId>ElCamino.AspNetCore.Identity.DocumentDB</PackageId>
<PackageTags>ASP.NET;Identity Core;Azure;DocumentDB;MVC;UserStore;RoleStore;UserManager;multi-tenant;RA-GRS;geo-redundant;Microsoft.AspNetCore.Identity</PackageTags>
<PackageTags>ASP.NET;Identity Core;Azure;DocumentDB;MVC;UserStore;RoleStore;UserManager;Microsoft.AspNetCore.Identity</PackageTags>
<PackageReleaseNotes>This project is an open source high performance plugin to ASP.NET Core Identity framework using Azure DocumentDB.
* Performance improvement to DocumentDB client initialization.
</PackageReleaseNotes>
<PackageIconUrl>https://dlmelendez.github.io/identityazuretable/images/projectNugetPic.png</PackageIconUrl>
<PackageLicenseUrl>https://github.com/dlmelendez/identitycoredocumentdb/blob/master/LICENSE</PackageLicenseUrl>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/dlmelendez/identitycoredocumentdb.git</RepositoryUrl>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Version>0.9.2</Version>
<Version>1.0.0</Version>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
<PackageProjectUrl>https://github.com/dlmelendez/identitycoredocumentdb</PackageProjectUrl>
</PropertyGroup>

<ItemGroup>
Expand Down
40 changes: 40 additions & 0 deletions src/ElCamino.AspNetCore.Identity.DocumentDB/Helpers/HashHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// MIT License Copyright 2017 (c) David Melendez. All rights reserved. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;

namespace ElCamino.AspNetCore.Identity.DocumentDB.Helpers
{
public static class HashHelper
{
public static SHA256 sha = SHA256.Create();

public static string ConvertToHash(string input)
{
return GetHash(sha, input);
}

private static string GetHash(SHA256 shaHash, string input)
{
// Convert the input string to a byte array and compute the hash.
byte[] data = shaHash.ComputeHash(Encoding.UTF8.GetBytes(input));
Console.WriteLine(string.Format("Key Size before hash: {0} bytes", Encoding.UTF8.GetBytes(input).Length));

// Create a new Stringbuilder to collect the bytes
// and create a string.
StringBuilder sBuilder = new StringBuilder(32);

// Loop through each byte of the hashed data
// and format each one as a hexadecimal string.
for (int i = 0; i < data.Length; i++)
{
sBuilder.Append(data[i].ToString("X2"));
}
Console.WriteLine(string.Format("Key Size after hash: {0} bytes", data.Length));

// Return the hexadecimal string.
return sBuilder.ToString();
}
}
}
Loading

0 comments on commit ca3f68a

Please sign in to comment.