Sign in to follow this  
Followers 0
monoceres

Raw file writing

3 posts in this topic

I have this 40 character long hex string: B15C342F1DE186996BCCA5E1A23CD684D2FADB32 (It's a SHA1 hash) and I would like to have this string written to a text file, the problem is though that the string shouldn't look, but rather as this: ±\4/ákÌ¥á¢<ÖÒúÛ2. I figured that it must be some kind of raw binary string because if you open a textfile in binary mode containing the raw string and then read it to a variable you get the first hex string.

Any input will be much appreciated :)


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Kinda hard to tell what you're asking for -- your post is unclear.

1) If you want to grab the string from the binary, simply use StringTrimLeft($bData, 2). StringTrimLeft() automatically converts $bData into a string.

2) If you have a non-binary string and want it written as binary, then simply do something like Binary("0x" & $sData) before you write it (assuming it's a proper hex string without the "0x" prefix, I guess).

Edited by -Ultima-

[ WinINet.au3 | Array.au3 (Optimized) | _UnixTimeParse() ]

Share this post


Link to post
Share on other sites

2) If you have a non-binary string and want it written as binary, then simply do something like Binary("0x" & $sData) before you write it.

Thank, you I had forgotten the 0x :)

Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0