Search Results

Search found 3489 results on 140 pages for 'all numeric no hash'.

Page 4/140 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Prevent query string manipulation by adding a hash?

    - by saille
    To protect a web application from query string manipulation, I was considering adding a query string parameter to every url which stores a SHA1 hash of all the other query string parameters & values, then validating against the hash on every request. Does this method provide strong protection against user manipulation of query string values? Are there any other downsides/side-effects to doing this? I am not particularly concerned about the 'ugly' urls for this private web application. Url's will still be 'bookmarkable' as the hash will always be the same for the same query string arguments. This is an ASP.NET application.

    Read the article

  • MD5 hash differences between Python and other file hashers

    - by Sam
    I have been doing a bit of programming in Python (still a n00b at it) and came across something odd. I made a small program to find the MD5 hash of a filename passed to it on the command line. I used a function I found here on SO. When I ran it against a file, I got a hash "58a...113". But when I ran Microsoft's FCIV or the md5sum.py in \Python26\Tools\Scripts\, I get a different hash, "591...ae6". The actual hashing part of the md5sum.py in Scripts is m = md5.new() while 1: data = fp.read(bufsize) if not data: break m.update(data) out.write('%s %s\n' % (m.hexdigest(), filename)) This looks functionally identical to the code in the function given in the other answer... What am I missing? (This is my first time posting to stackoverflow, please let me know if I am doing it wrong.)

    Read the article

  • How to sort Ruby Hash based on date?

    - by Eki Eqbal
    I have a hash object with the following structure: {"action1"=> {"2014-08-20"=>0, "2014-07-26"=>1, "2014-07-31"=>1 }, "action2"=> {"2014-08-01"=>2, "2014-08-20"=>2, "2014-07-25"=>2, "2014-08-06"=>1, "2014-08-21"=>1 } "action3"=> {"2014-07-30"=>2, "2014-07-31"=>1, "2014-07-22"=>1, } } I want to sort the hash based on the date and return back a Hash(Not array). The final result should be: {"action1"=> {"2014-07-26"=>1, "2014-07-31"=>1, "2014-08-20"=>0 }, "action2"=> {"2014-07-25"=>2, "2014-08-01"=>2, "2014-08-06"=>2, "2014-08-20"=>1, "2014-08-21"=>1 } "action3"=> {"2014-07-22"=>1, "2014-07-30"=>2, "2014-07-31"=>1 } }

    Read the article

  • javascript location.hash refreshing in IE

    - by aepheus
    I need to modify the hash, remove it after certain processing takes place so that if the user refreshes they do not cause the process to run again. This works fine in FF, but it seems that IE is reloading every time I try to change the hash. I think it is related to other things that are loading on the page, though I am not certain. I have an iframe that loads (related to the process) as well as some scripts that are still being fetched in the parent window. I can't seem to figure out a good way to change the hash after all the loading completes. And, at the same time am not even positive that it is related to the loading. Any ideas on how to solve this?

    Read the article

  • Cleaner way to store to replace a scalar hash value with an array ref?

    - by user275455
    I am building a hash where the keys, associated with scalars, are not necessarily unique. I want the desired behavior to be that if the key is unique, the value is the scalar. If the key is not unique, I want the value to be an array reference of the scalars associated witht the key. Since the hash is built up iteratively, I don't know if the key is unique ahead of time. Right now, I am doing something like this: if(!defined($hash{$key})){ $hash{$key} = $val; } elseif(ref($hash{$key}) ne 'ARRAY'){ my @a; push(@a, $hash{$key}); push(@, $val); $hash{$key} = \@a; } else{ push(@{$hash{$key}}, $val); } Is there a simpler way to do this?

    Read the article

  • Perl array and hash manipulation using map

    - by somebody
    I have the following test code use Data::Dumper; my $hash = { foo => 'bar', os => 'linux' }; my @keys = qw (foo os); my $extra = 'test'; my @final_array = (map {$hash->{$_}} @keys,$extra); print Dumper \@final_array; The output is $VAR1 = [ 'bar', 'linux', undef ]; Shouldn't the elements be "bar, linux, test"? Why is the last element undefined and how do I insert an element into @final_array? I know I can use the push function but is there a way to insert it on the same line as using the map command? Basically the manipulated array is meant to be used in an SQL command in the actual script and I want to avoid using extra variables before that and instead do something like: $sql->execute(map {$hash->{$_}} @keys,$extra);

    Read the article

  • Split Entire Hash Range Into n Equal Ranges

    - by noxtion
    Hello. I am looking to take a hash range (md5 or sha1) and split it into n equal ranges. For example, if n=5, the entire hash range would be split by 5 so that there would be a uniform distribution of key ranges. I would like n=1 to be from the beginning of the hash range to 1/5, 2 from 1/2 to 2/5, etc all the way to the end. I am new to hashing and a little bit unsure of where I could start on solving this for a project. Any help you could give would be great.

    Read the article

  • Simple Hash that is always equal between C# and Java

    - by GaiusSensei
    I have a C# WebService and a (Java) Android Application. Is there a SIMPLE hash function that produces the same result between these two languages? The simplest C# hash is a String.GetHashCode(), but I can't replicate it in Java. The simplest Java hash is not simple at all. And I don't know if I can replicate it exactly in C#. In case it's relevant, I'm hashing passwords before sending it across the internet. I'm currently using Encode64, but that's obviously not secure since we can reverse it.

    Read the article

  • Comparing large strings in JavaScript with a hash

    - by user4815162342
    I have a form with a textarea that can contain large amounts of content (say, articles for a blog) edited using one of a number of third party rich text editors. I'm trying to implement something like an autosave feature, which should submit the content through ajax if it's changed. However, I have to work around the fact that some of the editors I have as options don't support an "isdirty" flag, or an "onchange" event which I can use to see if the content has changed since the last save. So, as a workaround, what I'd like to do is keep a copy of the content in a variable (let's call it lastSaveContent), as of the last save, and compare it with the current text when the "autosave" function fires (on a timer) to see if it's different. However, I'm worried about how much memory that could take up with very large documents. Would it be more efficient to store some sort of hash in the lastSaveContent variable, instead of the entire string, and then compare the hash values? If so, can you recommend a good javascript library/jquery plugin that implements an appropriate hash for this requirement?

    Read the article

  • Reversing a hash function

    - by martani_net
    Hi, I have the following hash function, and I'm trying to get my way to reverse it, so that I can find the key from a hashed value. uint Hash(string s) { uint result = 0; for (int i = 0; i < s.Length; i++) { result = ((result << 5) + result) + s[i]; } return result; } The code is in C# but I assume it is clear. I am aware that for one hashed value, there can be more than one key, but my intent is not to find them all, just one that satisfies the hash function suffices. Any ideas? Thank you.

    Read the article

  • Short Python alphanumeric hash with minimal collisions

    - by ensnare
    I'd like to set non-integer primary keys for a table using some kind of hash function. md5() seems to be kind of long (32-characters). What are some alternative hash functions that perhaps use every letter in the alphabet as well as integers that are perhaps shorter in string length and have low collision rates? Thanks!

    Read the article

  • turn a ruby hash into html list

    - by JAlberto
    I'm trying to parse a yaml file like this: a: a1: a2: b: b1: b11: b2: i get a hash like this: {"a"=>{"a1"=>nil, "a2"=>nil}, "b"=>{"b1"=>{"b11"=>nil}, "b2"=>nil}} and i want to turn it to a list: %ul %li a %ul %li a1 %li a2 %li b %ul %li b1 %ul %li b11 %li b2 I'm trying to search the most efficent way doesn't matter how deep is the hash

    Read the article

  • Ruby Inserting Key, Value elements in Hash.

    - by kokogyi
    I want to add elements to my Hash lists, which can have more than one value. Here is my code. I don't know how I can solve it! class dictionary def initialize(publisher) @publisher=publisher @list=Hash.new() end def []=(key,value) @list << key unless @list.has_key?(key) @list[key] = value end end dic = Dictionary.new dic["tall"] = ["long", "word-2", "word-3"] p dic Many thanks in advance. regards, koko

    Read the article

  • Creating a unique URL safe hash

    - by Ben Foster
    I want to hash/encode a unique integer (database ID) to create a similarly unique string. It needs to meet the following requirements: Must start with a letter or number, and can contain only letters and numbers. All letters in a container name must be lowercase. Must be from 3 through 63 characters long (although the shorter the better) The result does not need to be reversible, just repeatable - so a 1-way hash would be fine.

    Read the article

  • Perl, time efficient hash

    - by Mike
    Is it possible to use a Perl hash in a manner that has O(log(n)) lookup and insertion? By default, I assume the lookup is O(n) since it's represented by an unsorted list. I know I could create a data structure to satisfy this (ie, a tree, etc) however, it would be nicer if it was built in and could be used as a normal hash (ie, with %)

    Read the article

  • mootools hash() in jquery?

    - by terrani
    Hi, I have been using mootools for a year now. I need to use jquery for my new projects. I always used hash() to make namespaces for my functions in mootools. For example, var person = new Hash({ say_name: function(){ }, say_age: function(){ } }); Does Jquery has similar stuff?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >