GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — WIP - Implement Get-Hash cmdlet by iSazonov · Pull Request #3395 · PowerShell/PowerShell

WIP - Implement Get-Hash cmdlet #3395

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.

Sign up for GitHub

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

Closed
Ilya (iSazonov) wants to merge 5 commits into PowerShell:master from iSazonov:gethashrfc

Uh oh!

There was an error while loading. Please reload this page.

Closed

WIP - Implement Get-Hash cmdlet #3395

Changes from 1 commit
Commits
Show all changes
5 commits
Select commit Hold shift + click to select a range
fe11148
Implement Get-Hash cmdlet
iSazonov Mar 22, 2017
f09a80b
Cleanup tests
iSazonov Jul 24, 2017
94a4c98
Add test for piping a path
iSazonov Jul 25, 2017
e9a5583
Address code review
iSazonov Aug 12, 2017
59c9996
Tabs to spaces
lzybkr Aug 13, 2017
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
Tabs to spaces
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@lzybkr @iSazonov
lzybkr authored and iSazonov committed Dec 19, 2017
commit 59c99961cdaefac419e5575ab8d07f8b38b000c7

There are no files selected for viewing

24 changes: 12 additions & 12 deletions 24 src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHash.cs
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,18 @@ protected override void ProcessRecord()
{
foreach (string str in InputString)
{
if (str == null)
{
WriteStringHashInfo(Algorithm, string.Empty, string.Empty, Encoding);
Exception exception = new Exception("Hash for 'null' string is 'null'");
WriteError(new ErrorRecord(exception, "GetHashInvalidData", ErrorCategory.InvalidData, null));
}
else
{
byte[] bytehash = hasher.ComputeHash(EncodingConversion.Convert(this, Encoding).GetBytes(str));
string hash = BitConverter.ToString(bytehash).Replace("-","");
WriteStringHashInfo(Algorithm, hash, str, Encoding);
}
if (str == null)
{
WriteStringHashInfo(Algorithm, string.Empty, string.Empty, Encoding);
Exception exception = new Exception("Hash for 'null' string is 'null'");
WriteError(new ErrorRecord(exception, "GetHashInvalidData", ErrorCategory.InvalidData, null));
}
else
{
byte[] bytehash = hasher.ComputeHash(EncodingConversion.Convert(this, Encoding).GetBytes(str));
string hash = BitConverter.ToString(bytehash).Replace("-","");
WriteStringHashInfo(Algorithm, hash, str, Encoding);
}
}
}

Expand Down
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.