monoceres Posted March 27, 2008 Share Posted March 27, 2008 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! Link to comment Share on other sites More sharing options...
-Ultima- Posted March 27, 2008 Share Posted March 27, 2008 (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 March 27, 2008 by -Ultima- [ WinINet.au3 | Array.au3 (Optimized) | _UnixTimeParse() ] Link to comment Share on other sites More sharing options...
monoceres Posted March 27, 2008 Author Share Posted March 27, 2008 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! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now