-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
5 changed files
with
586 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/NETCore.Encrypt/Extensions/Internal/ArrayExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace NETCore.Encrypt.Extensions.Internal | ||
{ | ||
internal static class ArrayExtensions | ||
{ | ||
/// <summary> | ||
/// sub datas from array | ||
/// </summary> | ||
/// <typeparam name="T"></typeparam> | ||
/// <param name="arr"></param> | ||
/// <param name="start"></param> | ||
/// <param name="count"></param> | ||
/// <returns></returns> | ||
internal static T[] Sub<T>(this T[] arr, int start, int count) | ||
{ | ||
T[] val = new T[count]; | ||
for (var i = 0; i < count; i++) | ||
{ | ||
val[i] = arr[start + i]; | ||
} | ||
return val; | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/NETCore.Encrypt/Extensions/Internal/StreamExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Text; | ||
|
||
namespace NETCore.Encrypt.Extensions.Internal | ||
{ | ||
internal static class StreamExtensions | ||
{ | ||
/// <summary> | ||
/// Stream write all bytes | ||
/// </summary> | ||
/// <param name="stream"></param> | ||
/// <param name="byts"></param> | ||
static public void WriteAll(this Stream stream, byte[] byts) | ||
{ | ||
stream.Write(byts, 0, byts.Length); | ||
} | ||
} | ||
} |
Oops, something went wrong.