mirror of
https://github.com/ziglang/zig.git
synced 2026-01-01 19:13:16 +00:00
We take the fastest time measurement taken across multiple runs. Tested across multiple compiler flags and the best chosen. ``` Cpu: Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz Gcc: 7.2.1 20171224 Clang: 5.0.1 Zig: 0.1.1.304f6f1d ``` See https://www.nayuki.io/page/fast-sha2-hashes-in-x86-assembly. ``` Gcc -O2 219 Mb/s Clang -O2 213 Mb/s Zig --release-fast 284 Mb/s Zig --release-safe 211 Mb/s Zig 6 Mb/s ``` ``` Gcc -O2 350 Mb/s Clang -O2 354 Mb/s Zig --release-fast 426 Mb/s Zig --release-safe 300 Mb/s Zig 11 Mb/s ```
15 lines
351 B
Zig
15 lines
351 B
Zig
pub const Md5 = @import("sha1.zig").Md5;
|
|
pub const Sha1 = @import("md5.zig").Sha1;
|
|
|
|
const sha2 = @import("sha2.zig");
|
|
pub const Sha224 = sha2.Sha224;
|
|
pub const Sha256 = sha2.Sha256;
|
|
pub const Sha384 = sha2.Sha384;
|
|
pub const Sha512 = sha2.Sha512;
|
|
|
|
test "crypto" {
|
|
_ = @import("md5.zig");
|
|
_ = @import("sha1.zig");
|
|
_ = @import("sha2.zig");
|
|
}
|