Pack function in C#

View: New views
2 Messages — Rating Filter:   Alert me  

Pack function in C#

by Symbian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hello,

Our PHP dev (who has since left) uses the pack function to turn a base64 string into a binary blob (?):

$blob = pack("H*", $postBase64Data);

Does anyone know what the above is doing? I need to translate that to C# terms, which I thought was getting the eqivalent of the bytes:

byte[] blob = ASCIIEncoding.UTF8.GetBytes(postedData);

But this may not be right.

Sym

Re: Pack function in C#

by Per Jessen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Symbian wrote:

>
> hello,
>
> Our PHP dev (who has since left) uses the pack function to turn a
> base64 string into a binary blob (?):
>
> $blob = pack("H*", $postBase64Data);
>
> Does anyone know what the above is doing?

Doesn't the manual tell you:

http://www.php.net/manual/en/function.pack.php


/Per Jessen, Zürich

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php