-
Notifications
You must be signed in to change notification settings - Fork 1k
[Move] Part-3 Classes into Different Library - Neo.Extensions
#3400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
NGDAdmin
merged 17 commits into
neo-project:master
from
cschuchardt88:rebuild/the-split-3
Jul 30, 2024
Merged
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
bf93412
Part-1 `Neo.IO` - move
cschuchardt88 4d08154
Part-2
cschuchardt88 597c9ca
Merge branch 'master' into rebuild/the-split-2
cschuchardt88 9881579
Added `BigInteger` to `Neo.Extensions`
cschuchardt88 8779151
Found more `BigInteger`
cschuchardt88 ed34707
Added `ByteArray` to `Neo.Extensions`
cschuchardt88 dbbf5b3
Merge branch 'master' into rebuild/the-split-2
shargon b64435b
Added Tests
cschuchardt88 583e610
Merge branch 'rebuild/the-split-2' of https://github.com/cschuchardt8…
cschuchardt88 6a50385
Merge branch 'rebuild/the-split-2' into rebuild/the-split-3
cschuchardt88 58f7fee
Added `tests` from `Part-2`
cschuchardt88 5d0e64e
Merge branch 'master' into rebuild/the-split-3
cschuchardt88 2c4a341
Merge branch 'master' into rebuild/the-split-3
cschuchardt88 c5f2f3e
Merge branch 'master' into rebuild/the-split-3
cschuchardt88 b5f7656
Merge branch 'master' into rebuild/the-split-3
c687a4c
Merge branch 'master' into rebuild/the-split-3
55705fa
Merge branch 'master' into rebuild/the-split-3
shargon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,59 @@ | ||
| // Copyright (C) 2015-2024 The Neo Project. | ||
| // | ||
| // ByteExtensions.cs file belongs to the neo project and is free | ||
| // software distributed under the MIT software license, see the | ||
| // accompanying file LICENSE in the main directory of the | ||
| // repository or http://www.opensource.org/licenses/mit-license.php | ||
| // for more details. | ||
| // | ||
| // Redistribution and use in source and binary forms with or without | ||
| // modifications are permitted. | ||
|
|
||
| using System; | ||
| using System.Text; | ||
|
|
||
| namespace Neo.Extensions | ||
| { | ||
| public static class ByteExtensions | ||
| { | ||
| /// <summary> | ||
| /// Converts a byte array to hex <see cref="string"/>. | ||
| /// </summary> | ||
| /// <param name="value">The byte array to convert.</param> | ||
| /// <returns>The converted hex <see cref="string"/>.</returns> | ||
| public static string ToHexString(this byte[] value) | ||
| { | ||
| StringBuilder sb = new(); | ||
| foreach (var b in value) | ||
| sb.AppendFormat("{0:x2}", b); | ||
| return sb.ToString(); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Converts a byte array to hex <see cref="string"/>. | ||
| /// </summary> | ||
| /// <param name="value">The byte array to convert.</param> | ||
| /// <param name="reverse">Indicates whether it should be converted in the reversed byte order.</param> | ||
| /// <returns>The converted hex <see cref="string"/>.</returns> | ||
| public static string ToHexString(this byte[] value, bool reverse = false) | ||
| { | ||
| StringBuilder sb = new(); | ||
| for (var i = 0; i < value.Length; i++) | ||
| sb.AppendFormat("{0:x2}", value[reverse ? value.Length - i - 1 : i]); | ||
| return sb.ToString(); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Converts a byte array to hex <see cref="string"/>. | ||
| /// </summary> | ||
| /// <param name="value">The byte array to convert.</param> | ||
| /// <returns>The converted hex <see cref="string"/>.</returns> | ||
| public static string ToHexString(this ReadOnlySpan<byte> value) | ||
| { | ||
| StringBuilder sb = new(); | ||
| foreach (var b in value) | ||
| sb.AppendFormat("{0:x2}", b); | ||
| return sb.ToString(); | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.