Skip to main content

Encoding Algorithms in fast infoset

6 replies [Last post]
eiresh
Offline
Joined: 2007-06-05

i am currently on a fast infoset project in c which is an open source one. At the case of encoding algorithms i could read about base64 encoding algorithm. so at there binary stream is divided in to 6bits parts and by looking at the number that each part represents, it puts the relevant character.

So i need to know that the remaining algorithms like float, double, uuid, hexadecimal, int(built in algorithms), do have same way of algorithm.
That means; takes the binary stream and divide them into parts (including several bits) and by looking at each number , puts the relevant character.
So any one who touches this area please give me a clue or resources which relevants to.
thanks.

Message was edited by: eiresh

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sandoz
Offline
Joined: 2003-06-20

I would point you to the specification but unfortunately it seems it is not available from here [1] anymore :-(

Read my blog articles on Fast Infoset [2], especially this one [3] as it shows an example of using the base64 and float encoding algorithms.

The base64 encoding algorithm is rather confusing. It actual encodes a string of octets that *would* be base64 encoded if the XML encoding was used.

Paul.

[1] http://asn1.elibel.tm.fr/en/standards/index.htm#applications
[2] http://blogs.sun.com/sandoz/category/Fast+Infoset
[3] http://blogs.sun.com/sandoz/entry/xml_to_typed_fi_utility

eiresh
Offline
Joined: 2007-06-05

hi , i m really happy to hear from you specially as you from OSS.Thanks lot for your links.When i read more about base64 encoding i felt that this encoding is a really nonsense because here we put one character representing six bits. but one character is eight bits. So ultimately six bits are represented by eight bits. So what is the compression there. I dont know whether i m misunderstood.So do we have any other optimization there. With this i feel there is something i did nt understand. Am i correct. Please put a little note on this.
aruna ireshan
intern- wso2.inc

sandoz
Offline
Joined: 2003-06-20

I am not from OSS, but from Sun. Alessandro who replied to you on the asn1@asn1.org list is from OSS.

I really do recommend looking close at:

http://blogs.sun.com/sandoz/entry/xml_to_typed_fi_utility

look at the XML and the base64 encoded values then look at the octets of the FI document.

Notice that the octets that are base 64 encoded in the XML document, "AAAAAAAAAAAAAAAA", are not encoded as UTF-8 encoded characters (a sequence of 16 octets, value of 65) but as the octets themselves, 00 (nul). So "AAAAAAAAAAAAAAAA" is encoded in 12 octets instead of 16 octets.

eiresh
Offline
Joined: 2007-06-05

i m really sorry sandoz i have done huge mistake. I believe you can understand how the people behave when the thing are jumbled.
So any way i'll look at it and send you any response.

sandoz
Offline
Joined: 2003-06-20

Hi Aruna, no need to apologize!, this is a rather confusing area given the conceptual way things are defined (in terms of characters) and the expected common usage. Paul.

eiresh
Offline
Joined: 2007-06-05

hi Paul,
i could build the fi package successfully and i run the all the samples too. But i couldn't run the part at the blog which says to run
"xmltosaxtotypedfi schema/Content.xsd content.xml content.fi"
i'm currently using linux. so do i need to use some any other command before it. i believe i 'm talking about right thing. I went to the given folder and typed it. but that doesn't work. it says
that
bash:xmltosaxtotypedfi
is not found.
Any way i got the real idea behind the base64 encoding, that is not to use for compress and this is use to encode binary stream to a character data stream specially at the email attachments.
For an example binary data, is not allowed to transfer through SMTP so base64 come in front and do the necessary. If this is wrong please correct me.
aruna