From WikiChip
Editing mirc/identifiers/$sha512

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.

Latest revision Your text
Line 36: Line 36:
  
 
Note that because the default is N=0, '''$sha512($mircexe)''' is the SHA512 hash for the plaintext text string of the drive:\path\filename for the mIRC you're running, and not the hash of the filename contents. This differs from $crc($mircexe) giving the checksum of the filename contents because $crc has default of N=2.<br />
 
Note that because the default is N=0, '''$sha512($mircexe)''' is the SHA512 hash for the plaintext text string of the drive:\path\filename for the mIRC you're running, and not the hash of the filename contents. This differs from $crc($mircexe) giving the checksum of the filename contents because $crc has default of N=2.<br />
mIRC v7.x Unicode-encodes bytes 128-255 to utf8 before providing to $sha512, if the text doesn't have code points above 255, you can avoid the utf8 encoding issue by using a binvar with the -a switch.
+
mIRC v7.x Unicode-encodes bytes 128-255 to utf8 before providing to $sha512, so v7.x and v6.x return different answers for //echo -a $sha1($chr(233))
 +
 
 +
If the text doesn't have code points above 255, you can avoid the utf7 encoding issue by using a binvar with the -a switch;
  
 
<pre>//bset -ta &string 1 chloé | echo -a $sha1(&string,1)</pre>
 
<pre>//bset -ta &string 1 chloé | echo -a $sha1(&string,1)</pre>
  
 
== Error Messages ==
 
== Error Messages ==
Note that $sha512 differs from $crc in that it generates error for non-existent files instead of returning hash of $null string. Also, hex string returned by $sha512 is lowercase while $crc returns uppercase hex.
+
Note that $sha1 differs from $crc in that it generates error for non-existent files instead of returning hash of $null string. Also, hex string returned by $sha1 is lowercase while $crc returns uppercase hex.
  
<pre>* Error accessing file: $sha512</pre>
+
<pre>* Error accessing file: $sha1</pre>
Either file does not exist, or file permissions don't allow the file to be read. i.e. $sha512(non-existent-file,2) or $sha512(c:\hiberfil.sys,2)
+
Either file does not exist, or file permissions don't allow the file to be read. i.e. $sha1(non-existent-file,2) or $sha1(c:\hiberfil.sys,2)
  
<pre>* Invalid parameters: $sha512</pre>
+
<pre>* Invalid parameters: $sha1</pre>
 
Either using a zero-length/non-existent binary variable or specifying an N where $int(%N) isn't 0-2.
 
Either using a zero-length/non-existent binary variable or specifying an N where $int(%N) isn't 0-2.
  
Line 52: Line 54:
  
 
== Compatibility ==
 
== Compatibility ==
{{mIRC compatibility|7.42}}
+
{{mIRC compatibility|6.3}}
  
 
== See also ==
 
== See also ==
Line 59: Line 61:
 
* {{mIRC|$sha256}}
 
* {{mIRC|$sha256}}
 
* {{mIRC|$sha384}}
 
* {{mIRC|$sha384}}
* {{mIRC|$sha1}}
+
* {{mIRC|$sha512}}
 
* [[List of identifiers - mIRC]]
 
* [[List of identifiers - mIRC]]
 
{{mIRC identifier list}}
 
{{mIRC identifier list}}
 
[[Category:mIRC identifiers|sha512]]
 
[[Category:mIRC identifiers|sha512]]

Please note that all contributions to WikiChip may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see WikiChip:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)