hash

Stored procedure that (doesn't) returns hashed string

I'm trying to write a Stored Procedure which'll get a string, hash it with SHA1 and then return the hash. I can't seem to make it return @hashedString. I'll admit I'm a total beginner with T-SQL. I'm writing the T-SQL directly in the db. This is what I've gotten up to now: ALTER PROCEDURE dbo.ConvertToHash ( @stringToHash nvarcha...

Ruby: Hash Assignment/Parse from Text

Looking to create a hash table from a text output that looks like this (whitespace between words are tabs): GCOLLECTOR 123456 77889 uno BLOCK unique111 error fullunique111 ... ... ... DAY ... ... ... LABEL detail unique111 Issue Broken - The truck broke LABEL detail ...

Encoding user input as URL GET parameter in JavaScript

I'm writing a JavaScript function that needs to uphold three properties: be very small and lightweight - no external libraries encode a string in such a way as to be able to be passed as a GET parameter this string must be decoded again at its destination Effectively, it authenticates the user by sending his username and password to ...

Get Hash URL from anchor and load into Div

Hello there, I have a video gallery that has a menu on the left and loads the content into a div on the right hand side. The menu is generated from php video posts so we need a general script that will effect everything. -- The problem -- The links will load the URL of the video as an anchor on the current URL - eg. http://www.divet...

Generate random string from 4 to 8 characters in PHP

Hi guys!! I need to generate a string using PHP, it need to be unique and need to be from 4 to 8 characters (the value of a variable). I thought I can use crc32 hash but I can't decide how many characters, but sure it will be unique. In the other hand only create a "password generator" will generate duplicated string and checking the v...

Password hashing - how to upgrade?

There's plenty of discussion on the best algorithm - but what if you're already in production? How do you upgrade without having to reset on the user? EDIT/DISCLAIMER: Although I originally wanted a "quick fix" solution and chose orip's response, I must concede that if security in your application is important enough to be even bothe...

How to get wordpress plugin "Twitter hash" to show on page

Hey everyone! I cannot for my life figure out how to get the downloaded plugin Twitter hash (http://wordpress.org/extend/plugins/twitter-hash-tag-widget/) to show on my index.php page. Read about it and this HTML code was given as an example in many places: <li id=”twitter"> <ul> <li><a href=”http://www.site1.com/”&gt;Site One Name</a>...

Is there a standard way of representing an SHA1 hash as a C string, and how do I convert to it?

This question is about how to create an SHA-1 hash from an array of data in C using the OpenSSL library. It returns an array of 20 bytes, containing the hash. Is there some standard way of representing that data in string form, not binary? If so, is there a function in OpenSSL itself to convert to said string format? If not, how shoul...

Define URL to jump to a specific page element, height or anchor after ajax call.

I have a website running on wordpress and ajax. All the content ist loaded via ajax with deeplinking and hashHistory. URLs look like this: http://www.website.com/#/lang/page/ On one of the pages i want to implement multiple facebook like buttons to boost some of the contents popularity . To make this happen i need to specify dif...

Do you know an image hashing library ?

I am looking for a "fuzzy" hash library for images, that means, one library which can recognize an image even with some minor changes (different compression ratio, watermaks, small cropping etc...) I found pHash library, but there is no documentation about using it. Do you know one ? ...

MurmurHash - how does it loop through the key?

Hello, I am looking at MurmurHash (sites.google.com/site/murmurhash/) I'm using it in a black box kind of a way and not trying to undersatand the maths at this stage. However, I did have a little look at the code and got worried about how it seems to work... Here's the code: uint64_t MurmurHash64A ( const void * key, int len, unsigned...

smallest checksum on a string

scratching my head over this. i have 350 strings average 90 chars long, all strings are unique. Now, i wanna generate a unique id for each string. i tried the sum of chars in the string wich gave two doubles, the returned sum is not unique enough. Anybody any idea how to approach this? I thought of hash(), is that the best solution? a...

Is there a way to get SQL Server to automatically do selects on hash values of nvarchar fields?

I'm not sure how to better phrase this question so it's possible I missed a previously asked question. Feel free to close this and point me to the correct one if it exists. I have a table with two important columns (that is to say it has much more but only two is pertinent to this question). First column is a GUID (an id) and the second...

Hash string in c#

Hello there, I have problem when trying get hash string in c#. I already try research in few website, but most them using file to get hash. Even some there , for string, there bit complex. And other one I found it for window authentication for web like this: FormsAuthentication.HashPasswordForStoringInConfigFile(tbxPassword.Text.Trim(...

Is there standard way to generate Password Hash with Microsoft?

Is there standard way to generate Password Hash with Microsoft development tools? Or maybe there is most common way. (I have read that there is MD5, STA1) Unfortunately I don't have server's source code, but have to consume SOAP web-services. The must be some algorithm to generate hash code. I need to implement it using Java or using s...

How should I delete hash elements while iterating?

I have fairly large hash (some 10M keys) and I would like to delete some elements from it. I usually don't like to use delete or splice, and I wind up copying what I want instead of deleting what I don't. But this time, since the hash is really large, I think I'd like to delete directly from it. So I'm doing something like this: forea...

How to implement a good __hash__ function in python

When implementing a class with multiple properties (like in the toy example below), what is the best way to handle hashing? I guess that the __eq__ and __hash__ should be consistent, but how to implement a proper hash function that is capable of handling all the properties? class AClass: def __init__(self): self.a = None ...

why should a good hash algorithm not allow attackers to find two messages producing the same hash?

Hi, I was reading wikipedia, and it says Cryptographic hash functions are a third type of cryptographic algorithm. They take a message of any length as input, and output a short, fixed length hash which can be used in (for example) a digital signature. For good hash functions, an attacker cannot find two messages that p...

Groovy: sort hash keys by values value

I want to sort a hash of key->value by the values , and get the list of the sorted keys. This seems to work: groovy> def map = [a:5, b:3, c:6, d:4].sort { a, b -> a.value <=> b.value }.keySet() groovy> println map [b, d, a, c] but will it always work? I don't know if the iterator that builds the keySet() will always iterate the...

ActiveModel based class does not create the same results as an ActiveRecord equivilent

Hi, I am developing a Rails 3 app in a largely tabless capacity. I am using savon_model and ActiveModel to generate similar behaviour to ActiveRecord equivalents. Below is my code: class TestClass include Savon::Model include ActiveModel::Validations # Configuration endpoint "http://localhost:8080/app/TestService" namespac...