ianmackenzie / elm-iso-10303 / Step.Bytes

Low-level functionality for encoding and decoding Bytes values as specified in the STEP standard. In most case you will want to use Step.Decode.binaryData and Step.Encode.binaryData instead of using this module directly.

encode : Bytes -> String

Encode a Bytes value using method specified in the STEP standard (a form of Base64 encoding):

bytes =
    Bytes.Encode.encode (Bytes.Encode.unsignedInt16 Bytes.BE 1234)

Step.Bytes.encode bytes
--> "004D2"

Note that the leading and trailing double quotation marks (used when writing binary data to a STEP file) are not included in the result.

decode : String -> Bytes

Decode STEP-encoded bytes. The input is assumed not to include the leading and trailing double quotation marks used when writing binary data to a STEP file.