I think hex encoded string conversion is a important use case. Another idea - instead of making the Data type itself generic, there can be a generic Data.View<T : IntegerType> into the data, or the Data type can come with a number of Views for each of the fixed-width integer types.
Austin > On May 11, 2016, at 7:09 AM, Jeremy Pereira <[email protected]> > wrote: > > >> On 11 May 2016, at 10:37, Austin Zheng via swift-evolution >> <[email protected]> wrote: >> >> Hello swift-evolution, >> >> > > ... > >> Some thoughts: >> >> - It's not clear if the methods to convert to and from base-64 encoded data >> are necessary. The state flag that tries to mark whether or not a Data >> represents base-64-encoded string stored as a data may be unnecessary as >> well. >> > > I would definitely vote for having the base64 conversions in. The state flag > would have less utility IMO. > > I would also ask that you consider conversions to and from hex encoded > strings. If nothing else, it would make it easier to convert git commit > hashes to a readable form in my forthcoming git client vapourware. > _______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
