xsl-list
[Top] [All Lists]

Re: [xsl] how to decode Base64 in XSLT?

2010-04-14 22:19:34
I'm not sure if this would really help.

But I implemented a base64 encoding & decoding implementation natively
in XSLT some time ago (it is a 1.0 solution, since it was written long
time ago). It could be found at:

http://gandhimukul.tripod.com/xslt/base64-xslt.html

On Thu, Apr 15, 2010 at 1:36 AM, Ivan Shmakov <oneingray(_at_)gmail(_dot_)com> 
wrote:
       I'm developing an XML representation for the .torrent files.  It
       was quite trivial to convert the XML bit like, e. g.:

<?xml version="1.0" ?> <!-- -*- XML -*- -->
<torrent
  xmlns="http://www.siamics.net/~ivan/xmlns/xmltorrent";>

 <announce>http://TRACKER:PORT/announce</announce>
 <comment>COMMENT</comment>
 <created-by>CREATED-BY</created-by>
 <info>
   <length>31454056</length>
   <name>nomad3.ncep.noaa.gov/pub/gfs1p0/gfs20100320/gfs.t12z.pgrbf96</name>
   <piece-length>262144</piece-length>
 </info>
</torrent>

       to the “.torrent format”.  However, one of the most important
       parts of the .torrent file is the ‘pieces’ field, containing the
       SHA1 digests of the chunks represented as a single long binary
       string.  To my mind, it's reasonable to have such a field
       encoded in Base64, like:

<torrent ...>
 ...
 <info>
   ...
   <pieces>
     <digest>TCvyo4Na18vWlW19+pirwGKKMoU=</digest>
     <digest>hnWGTGoiouUIZWjX861YIxyMYaM=</digest>
     ...
   </pieces>
 </info>
</torrent>

       Now, how do I convert these Base64 strings into the respective
       binary strings?

--
FSF associate member #7257


-- 
Regards,
Mukul Gandhi

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>