| ... | ... | @@ -45,10 +45,10 @@ pub const ULID = struct { |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | 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(); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | pub const fromString = readField; |