[Original notes written ~1997, copied from handwritten A4] Generalised data transformation =============================== SWI DataConvert_TransformToName => R0 = transform number <= R1-> transform name R2-> transform group name Decodes a transform number to a name. SWI DataConvert_TransformFromName => R0 = transform group base, or -1 if not known R1-> transform name, or 0 to get group R2-> group name, or ignored if R0 is not -1 <= R0 = transform (group) number Decodes transform names to numbers. SWI DataConvert_Transform => R0 = transform number R1 = flags: b0 set for initial call b1 set if no more data is pending R2-> workspace, or 0 to return values R3-> input data block R4 = input data length R5-> output data block R6 = output data length <= R0 = reason code: 0 complete 1 need more input data 2 need more output buffer 3 transformation failed (inconsistent input) 4 transformation failed (transform is impossible) R1 preserved R2 = workspace required, if R0 was 0 preserved otherwise R3-> next byte that will be read if R2 is not 0 preserved otherwise R4 = minimum input buffer size if R2 is 0 input length remaining otherwise R5-> next byte to write to, if R2 is 0 output length remaining otherwise This will apply a transform to a block of data, allowing for streaming operations. Minimum input length will be -1 if the buffer must contain all the data due to encoding limitations. SWI DataConvert_TransformOption => R0 = transform number R1-> workspace, or 0 if a global data item R2 = option in form &RWGGTTOO RW = read if 0, write if 1 GG = group to access: 0 data for this transform 1 global data 2 transform data TT = type of data: 0 number 1 string 2 data block OO = option (transform specific) R3 = data R4 = data length (if applicable) or -1 to read length required. <= R3 = data R4 = data length (if applicable), or -1 for 'any' This call would be used to set up various parameters for the transform once it has been initialised. Transform data options: 0 string descriptive name 1 number version * 100 2 string author name more will probably be added. Any non-existant, or inconsistent, options will return an error. Transform group bases --------------------- &00000 Encoding - this is 're-writing data in a form that is capable of being transferred across other mediums safely'. &10000 Encryption - this is 'making the data secure such that only the intended recipients cna obtain the original'. &20000 Compression - this is 'making the data take less space than it did'. &30000 Hashing - this is 'reducing the data to some keyed value'. [Note: Corruption is not allocated a group!] Suggested encoding numbers -------------------------- &00001 UUcode (24bit->32bit encoding system using 6bit characters) &00002 Base64 (as UUcode but safer across Internet gateways) Suggested encryption numbers ---------------------------- &10001 Rot13 (shift alphabet 13 characters) &10002 DES ("standard" encryption) &10003 PGP (publicly available public key encryption) [Note: Encryption methods are covered by certain export laws and should be treated with care] Suggested compression numbers ----------------------------- &20001 RLE (simple run length encoding) &20002 Compress (aka Squash) &20003 Deflate (aka zlib) &21001 GSM ("standard" audio compression at 8kHz) It is suggested that compression be subdivided into: &20xxx Application &21xxx Sound &22xxx Image &23xxx Video