Implement algorithm switching

This commit implements every algorithm I have played with so far. It also allows for you to switch which algorithm you want to use at runtime.
This commit is contained in:
Zoe
2025-11-25 18:09:17 +00:00
parent 570531fe32
commit e16383e9b9
20 changed files with 1262 additions and 476 deletions

View File

@@ -0,0 +1,9 @@
const std = @import("std");
const Allocator = std.mem.Allocator;
pub fn hash(allocator: Allocator, data: []const u8) ![]u8 {
const output_hash = try allocator.alloc(u8, std.crypto.hash.sha2.Sha256.digest_length);
std.crypto.hash.sha2.Sha256.hash(data, @ptrCast(output_hash), .{});
return output_hash;
}