Learn Courses My Dashboard

String Extension

Can anyone advise on how to code an extension to String that implements the following protocol:

protocol GenericPasswordConvertible: CustomStringConvertible {
init(rawRepresentation data: D) throws where D: ContiguousBytes

// A raw representation of the key.
var rawRepresentation: Data { get }

}