https://github.com/deatil/zig-md2
A MD2 hash function library for Zig
https://github.com/deatil/zig-md2
md2 zig zig-md2
Last synced: 2 months ago
JSON representation
A MD2 hash function library for Zig
- Host: GitHub
- URL: https://github.com/deatil/zig-md2
- Owner: deatil
- License: apache-2.0
- Created: 2024-05-17T09:25:02.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-02-11T05:56:40.000Z (3 months ago)
- Last Synced: 2025-02-11T06:30:02.251Z (3 months ago)
- Topics: md2, zig, zig-md2
- Language: Zig
- Homepage: https://github.com/deatil/zig-md2
- Size: 11.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-zig - deatil/zig-md2
- awesome-zig - zig-md2🗒️A MD2 hash function for Zig
README
## Zig-MD2
zig-md2 is a MD2 hash function for Zig.
### Env
- Zig >= 0.14.0-dev.2851+b074fb7dd
### Adding zig-md2 as a dependency
Add the dependency to your project:
```sh
zig fetch --save=zig-md2 git+https://github.com/deatil/zig-md2#main
```or use local path to add dependency at `build.zig.zon` file
```zig
.{
.dependencies = .{
.@"zig-md2" = .{
.path = "./lib/zig-md2",
},
...
},
...
}
```And the following to your `build.zig` file:
```zig
const zig_md2_dep = b.dependency("zig-md2", .{});
exe.root_module.addImport("zig-md2", zig_md2_dep.module("zig-md2"));
```The `zig-md2` structure can be imported in your application with:
```zig
const zig_md2 = @import("zig-md2");
```### Get Starting
~~~zig
const std = @import("std");
const MD2 = @import("zig-md2").MD2;pub fn main() !void {
var out: [16]u8 = undefined;
var h = MD2.init(.{});
h.update("abc");
h.final(out[0..]);
// output: da853b0d3f88d99b30283a69e6ded6bb
std.debug.print("output: {x}\n", .{out});
}
~~~### LICENSE
* The library LICENSE is `Apache2`, using the library need keep the LICENSE.
### Copyright
* Copyright deatil(https://github.com/deatil).