Skip to content

Rewrite Get-FileHash on C# #2731

Description

@iSazonov

As approved in #2718 Get-FileHash should be rewritten on C#.

Activity

  1. rkeithhill commented on Nov 20, 2016

    @rkeithhill
    Collaborator

    BTW, any chance we could add a Get-Hash command as well that would operate on strings instead of files? This comes in handy. See the PSCX impl for Get-Hash as an example. Of course, if I were writing this command from scratch today, I would default to SHA256 instead of MD5. :-)

  2. added
    WG-Cmdletsgeneral cmdlet issues
    Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributors
    on Nov 20, 2016
  3. iSazonov commented on Nov 20, 2016

    @iSazonov
    CollaboratorAuthor

    default to SHA256 instead of MD5

    I agree but
    Is this a breaking change or not?

  4. rkeithhill commented on Nov 20, 2016

    @rkeithhill
    Collaborator

    Get-Hash doesn't exist right now so no worries about a breaking change. And the default Algorithm for Get-FileHash is SHA256. My only point is that it would be nice to have a cmdlet that hashes strings (in addition to the existing cmdlet that operates on files).

    It is a drag that if you want to hash a string, you have to write it to a file. OK that is not entirely true, you can hash a string directly but not many folks will figure this out:

    Get-FileHash -InputStream ([System.IO.MemoryStream]::new([System.Text.Encoding]::ASCII.GetBytes("open sesame")))
  5. iSazonov commented on Nov 21, 2016

    @iSazonov
    CollaboratorAuthor

    Keith Hill (@rkeithhill) Great idea!
    So maybe make new Get-Hash cmdlet with support file and string sources and make Get-FileHash as wrapper for it?

  6. iSazonov commented on Jan 19, 2017

    @iSazonov
    CollaboratorAuthor

    PowerShellTeam I started working on this, please assign me.

  7. removed
    Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributors
    on Jan 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions