Skip to content
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

support file path to base64 in parse #3487

Merged
merged 9 commits into from
Nov 5, 2024

Conversation

Hecate2
Copy link
Contributor

@Hecate2 Hecate2 commented Sep 12, 2024

Description

An enhancement for #3482 (but also works alone). Hex string input had already been supported in the method Base64Fixed, and is not considered.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update (maybe)

How Has This Been Tested?

  • Test A
    parse C:\Users\some_file.nef_or_anything
    Typically it prints quite a few screens of hex, base64 and instructions, if the input is a .nef path. It works when the input path includes spaces. The user can wrap the input path with or without double quotation marks ", whether the path includes spaces or not.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@superboyiii
Copy link
Member

For NEF base64, seems not with the same way. But maybe create another method like parseNEF is a good way.
image

@Hecate2
Copy link
Contributor Author

Hecate2 commented Sep 12, 2024

For NEF base64, seems not with the same way. But maybe create another method like parseNEF is a good way.

I see. This is base64(base64(.nefFile))

@Hecate2 Hecate2 changed the title support path input in parse support file path to base64 in parse Sep 12, 2024
@Hecate2
Copy link
Contributor Author

Hecate2 commented Sep 12, 2024

Changed this PR to support only file path to base64

{
if (!File.Exists(path)) return null;
return Convert.ToBase64String(File.ReadAllBytes(path));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I don't think we need this command for CLI because it's always possible to cat file.txt | base64.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

windows?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also possible but the command is a bit longer.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we need it?

cschuchardt88
cschuchardt88 previously approved these changes Oct 13, 2024
Copy link
Member

@shargon shargon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any use case for this

@Hecate2
Copy link
Contributor Author

Hecate2 commented Oct 13, 2024

I don't see any use case for this

To be honest, I do not think it useful either.

@shargon
Copy link
Member

shargon commented Oct 23, 2024

Close?

@cschuchardt88
Copy link
Member

cschuchardt88 commented Oct 23, 2024

there are some websites that require nef file to be base64 string. Best to keep this.

@shargon shargon merged commit 08ecb7e into neo-project:master Nov 5, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants