On Apr 23, 3:39 pm, Jean-Marc Desperrier jmd...@alussinan.org wrote:
Nelson B Bolyard wrote:
Is that python code? I thought it was JavaScript.
Yes, you're right, I had a really too quick look at it :-)
On a second thought, I just had a look at this page:
Right, this seems to work very well. I consider it solved.
Here is the corrected code:
hash: function(str,method) {
var converter = Components.classes[@mozilla.org/intl/
scriptableunicodeconverter].createInstance
(Components.interfaces.nsIScriptableUnicodeConverter);
Nelson B Bolyard wrote:
Is that python code? I thought it was JavaScript.
Yes, you're right, I had a really too quick look at it :-)
--
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto
If it helps, here is the code I currently utilize;
hash: function(str,method) {
var hash_engine = Components.classes[@mozilla.org/security/hash;
1].createInstance().QueryInterface
(Components.interfaces.nsICryptoHash);
switch(method) {
starryrendezv...@gmail.com wrote, On 2009-04-22 07:40:
If it helps, here is the code I currently utilize;
[snip]
I suspect (that is, guess) that your problem is at one of these two places:
1. Perhaps the following code does not pass the UTF8 string you expect it
to pass to the hash algorithm.
starryrendezv...@gmail.com wrote:
hash: function(str,method) {
[...] str.charCodeAt(i)
python quite probably outputs the value of str.charCodeAt(i) as some
variant of a UTF-16 value. Or UCS-2 with no handling of surrogates.
Under which format is the string inside the file that md5sum
Jean-Marc Desperrier wrote, On 2009-04-22 12:17 PDT:
starryrendezv...@gmail.com wrote:
hash: function(str,method) {
[...] str.charCodeAt(i)
python quite probably outputs the value of str.charCodeAt(i) as some
variant of a UTF-16 value. Or UCS-2 with no handling of surrogates.
Under
starryrendezv...@gmail.com wrote:
If it helps, here is the code I currently utilize;
hash: function(str,method) {
var hash_engine = Components.classes[@mozilla.org/security/hash;
1].createInstance().QueryInterface
(Components.interfaces.nsICryptoHash);
var
8 matches
Mail list logo