authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-10-21 21:14:29 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-10-21 21:14:29 -07:00
log6dd5abbe4d72caf88188ec0d1cb56bcad4cd95b4
treeebbd0d20adbadba16bdbdb5ae3e8b05f6d3f4d8b
parentee0eea0148421042c4a87141aa4a3cedee7048a1

rework bindField to capture format


1 files changed, 4 insertions(+), 4 deletions(-)

ulid.zig+4-4
......@@ -45,10 +45,10 @@ pub const ULID = struct {
4545 }
4646
4747 pub fn bindField(self: ULID, alloc: *std.mem.Allocator) !BaseType {
48 var res = try alloc.alloc(u8, 26);
49 base32.formatInt(u48, self.timestamp, res[0..10]);
50 base32.formatInt(u80, self.randomnes, res[10..26]);
51 return res;
48 var res = try std.ArrayList(u8).initCapacity(alloc, 26);
49 defer res.deinit();
50 try res.writer().print("{}", .{self});
51 return res.toOwnedSlice();
5252 }
5353
5454 pub const fromString = readField;