From fa67fd84a2cc9db16685220fcec1abd5cb8b6546 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Sun, 31 May 2026 23:47:26 -0700 Subject: [PATCH] update to zig 0.15.2 --- README.md | 2 +- totp.zig | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 55e59c33f892a5ec4385544956f126658d224564..492c3c04bb8e6ba75e4e2149855e497df1b92d00 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ![loc](https://sloc.xyz/github/nektro/zig-totp) [![license](https://img.shields.io/github/license/nektro/zig-totp.svg)](https://github.com/nektro/zig-totp/blob/master/LICENSE) [![nektro @ github sponsors](https://img.shields.io/badge/sponsors-nektro-purple?logo=github)](https://github.com/sponsors/nektro) -[![Zig](https://img.shields.io/badge/Zig-0.14-f7a41d)](https://ziglang.org/) +[![Zig](https://img.shields.io/badge/Zig-0.15-f7a41d)](https://ziglang.org/) [![Zigmod](https://img.shields.io/badge/Zigmod-latest-f7a41d)](https://github.com/nektro/zigmod) RFC 6238: TOTP: Time-Based One-Time Password Algorithm diff --git a/totp.zig b/totp.zig index 2739d35ea82c3a60ca69bd6dffb7961076882fed..83f22e500a3662110c3a50942c9286f0540e2656 100644 --- a/totp.zig +++ b/totp.zig @@ -56,7 +56,7 @@ pub fn generateUrl(allocator: std.mem.Allocator, issuer: []const u8, account: [] std.debug.assert(secret_raw.len <= algo.digest_length()); std.debug.assert(digits == 6 or digits == 7 or digits == 8); std.debug.assert(period == 15 or period == 30 or period == 60); - var list: std.ArrayList(u8) = .init(allocator); + var list: std.array_list.Managed(u8) = .init(allocator); errdefer list.deinit(); try list.appendSlice("otpauth://"); try list.appendSlice("totp/"); @@ -78,7 +78,7 @@ pub fn generateUrl(allocator: std.mem.Allocator, issuer: []const u8, account: [] // RFC3548 base32 // input.len is gonna be 64 | 32 | 64 -fn encodeBase32(list: *std.ArrayList(u8), input: []const u8) !void { +fn encodeBase32(list: *std.array_list.Managed(u8), input: []const u8) !void { const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; var iter = BufBiterator.init(input); while (iter.nextInt(u5)) |idx| try list.append(alphabet[idx]); -- 2.54.0