-
Notifications
You must be signed in to change notification settings - Fork 9
WIP: sha256sum applet #46
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const std = @import("std"); | ||
const stdout = &std.io.getStdOut().outStream().stream; | ||
|
||
pub fn sha256(name: []const u8) !void { | ||
// encoding function | ||
return; | ||
} | ||
|
||
pub fn main() !void { | ||
// out of memory panic | ||
const args = std.process.argsAlloc(std.heap.page_allocator) catch |err| { | ||
try stdout.print("Out of memory: {}\n", .{err}); | ||
return; | ||
}; | ||
defer std.process.argsFree(std.heap.page_allocator, args); | ||
|
||
// For now, do not handle case where arguments are from stdin | ||
if (args.len < 2) { | ||
try stdout.print("sha256sum: missing operands \n", .{}); | ||
return; | ||
} | ||
|
||
// return sha256sum of each argument given | ||
for (args) |arg, i| { | ||
if(i != 0){ | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting... I see what you are planning but I don't see any actual code here. Is this planned? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @eamonlm would love to hear your response to @sambattalio's question |
||
} | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you should implement sha256 here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still waiting for this feature! Super excited!