pub fn setString(self: *Managed, base: u8, value: []const u8) !void self: *Managedbase: u8value: []const u83044
3045
3046
3047
3048
3049
3050 pub fn setString(self: *Managed, base: u8, value: []const u8) !void {
if (base < 2 or base > 36) return error.InvalidBase;
try self.ensureCapacity(calcSetStringLimbCount(base, value.len));
var m = self.toMutable();
try m.setString(base, value);
self.setMetadata(m.positive, m.len);
}
Set self from the string representation
value.valuemust contain only digits <=baseand is case insensitive. Base prefixes are not allowed (e.g. 0x43 should simply be 43). Underscores in the input string are ignored and can be used as digit separators.Returns an error if memory could not be allocated or
valuehas invalid digits for the requested base.self's allocator is used for temporary storage to boost multiplication performance.