Questions tagged [hashing]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
59 views

Weird behavior of repeated Mod of Hash

I was working on a wolfram challenge problem involving Hash, and I noticed some very odd behavior. The problem is to create a function ...
ydd's user avatar
  • 3,453
1 vote
1 answer
81 views

How to remove/ (avoid) the # sign in "Solve" output [duplicate]

I am trying to find an equation of A with variable B using the Solve function. I have the first derivative of firm A's profit with respect to location a, which is equal to zero. I have the first ...
user89404's user avatar
6 votes
4 answers
331 views

Using multiple hashtags in NestList

Are multiple hashtags allowed in NestList usage? If yes, how to implement it? Example, f[{x_, y_}] := {x + y, x - y}; NestList[f, {100, 75}, 5] My attempt, ...
Aschoolar's user avatar
  • 883
4 votes
1 answer
106 views

Search speed of downvalues when indexing with strings

I'm writing a lot of print functions for different parts in a package and at the moment am using something like myprint[ identifierString_String ][ data_ ] := ... ...
Gert's user avatar
  • 1,470
4 votes
2 answers
114 views

From list to unique ID number AND back

If I have a series of list of the form $L_k=\{a_1, a_2,...a_n\}_k$ with $-4<a_i<4$ and $a_i\in\mathbb Z$, then I can make a unique ID number for $L_k$ using ...
DarkBulle's user avatar
  • 964
2 votes
1 answer
100 views

Unique matrix ID and fast checking

I have the following problem : I have a programm which can generate a lot of 3x3 matrices whose elements take integer values in [-3;3], example :{{1,2,3},{-3,0,-2},{1,1,1}}. Each time my programm ...
DarkBulle's user avatar
  • 964
8 votes
1 answer
515 views

How to define your own hash type?

Currently Mathematica offers support of a bunch of different hash algorithms. I would like to add my own to the list. In this way I can still use the function Hash[]...
9Harris's user avatar
  • 175
3 votes
1 answer
148 views

User implemented SHA-1 isn't outputting correct hash

EDIT: I'm actually Thinking the issue is in the initialization phase, where we pad the message with 1's, 0's, and the message ...
Shinaolord's user avatar
1 vote
0 answers
52 views

Keyed Hash for HMAC SHA256 [duplicate]

I'm trying to use AWS REST API's (because I can't rely on AWSLink`). The sample C# code from Amazon uses this a lot: ...
Eric William Smith's user avatar
1 vote
1 answer
86 views

Problem passing argument in hash table from global context to a module

I was experimenting with passing arguments via a hash table to a module. Found a very strange result. When I pass a function to be plotted inside the module, it comes out empty. Yet all argument ...
Nasser's user avatar
  • 137k
18 votes
2 answers
1k views

How has Hash changed in 11.3?

There are already few topic related to Hash[_String]: How does Hash calculate hash for strings? Incorrect calculating Hash SHA256 But it looks like changes are ...
Kuba's user avatar
  • 136k
1 vote
2 answers
312 views

Incorrect calculating Hash SHA256

At the moment I'm using version 11.2. A few days ago, after an update in my programs, I found errors. It turned out that the new version incorrectly computes the hash. I'm using method SHA256. And ...
Kirill Belov's user avatar
18 votes
1 answer
545 views

HMAC correct on 11.2 but wrong and different on 11.3 running same code

If you run this code on 11.2 ...
Ray Troy's user avatar
  • 1,289
8 votes
1 answer
438 views

How does Hash calculate hash for strings?

I have this code Hash["a","SHA"] Hash[ToCharacterCode["a"],"SHA"] and I was expecting to get the same result, but somehow it is different. My question is: how ...
Zlelik's user avatar
  • 531
4 votes
2 answers
170 views

J/Link HMAC Base64

I am trying to recreate a Java algorithm in Mathematica. It is taking a key and signing a message using the HMAC and SHA256 algorithm. The Java code for which I am basing it off is here I have ...
Ray Troy's user avatar
  • 1,289
3 votes
1 answer
338 views

Using Mathematica how can I simulate the MD5 or SHA encryption of a userid and password performed by htpasswd on Apache?

htpasswd hashes a user's password using the userid. Thus this generator takes both userid and password as inputs and then it outputs a line for inclusion in the <...
user avatar
5 votes
5 answers
1k views

Help converting geohash string to latitude, longitude?

I'm having difficulty converting a geohash string to latitude and longitude with Mathematica and wondered if I'm missing a built in function that already has the functionality available? (I'm still ...
FractalDoctor's user avatar
3 votes
1 answer
1k views

API HTTP Request Signing using base64 encoding/decoding and HMAC (Cryptocurrencies Exchange, GDAX)

I am trying to access the GDAX API private methods which can be seen here, GDAX Documentation There is some great Python code that does it that I am trying to recreate in Mathematica. That code can ...
Ray Troy's user avatar
  • 1,289
0 votes
0 answers
231 views

Algorithm that will trim a unique ID number and produce a shorter unique ID

I have a unique ID number with 2^128 magnitude length (128 bits). This means ~3.4e+38 which is quite large that my actually needs, spending valuable time in a transmission protocol. There is a ...
user1797147's user avatar
4 votes
1 answer
222 views

HMAC-SHA512 in mathematica and $SystemShell differences

Hi I'been trying to rebuild the script to get hmac-sha512 but could not get it work ...
Roman Golubtsov's user avatar
7 votes
2 answers
174 views

Hash reliability for uniqueness?

I have an algorithm that produces certain entries of data and appends them to a list myList = {};. For example, after five iterations the list might look like: <...
Kagaratsch's user avatar
  • 11.9k
3 votes
1 answer
227 views

Read RDF N-Triples and replace them with a hashed index 'on the fly'

I want to process a 181GB uncompressed RDF N-Triples file. You may download a small sample file (4KB) and read the file line by line. ...
Athanassios's user avatar
  • 1,291
13 votes
3 answers
3k views

How to calculate SHA256 of a number, not string

Mathematica always interprets the input of the Hash function as a string. I would expect this: ...
Jan Hubik's user avatar
  • 427
1 vote
0 answers
106 views

Is this a serious flaw in Mathematica's default hashing algorithm

Below, I define two expressions X and Y (which arose in the wild!) such that not only ...
Scott Morrison's user avatar
8 votes
1 answer
458 views

HMAC implementation in pure Mathematica

I am trying to implement the HMAC algorithm in Mathematica. The algorithm is a relatively simple way of signing messages with a key. Here is some pseudocode from Wikipedia: My attempt: ...
mfvonh's user avatar
  • 8,442
2 votes
0 answers
175 views

When does Mathematica automatically use dispatch tables for function evaluation? [closed]

I've read the documentation for Dispatch, and it says: Lists of rules produced by assignments made with = and := are automatically optimized with dispatch tables ...
Matt's user avatar
  • 743
5 votes
2 answers
575 views

Why should we make sure the calculated MD5 is of length 32?

I see when people write code on calculating MD5, (even in the documentation), they write like this: IntegerString[Hash[something, "MD5"], 16, 32] But I think ...
vapor's user avatar
  • 7,851
6 votes
2 answers
1k views

Why does the hash of a file differ from the hash of its content?

FileHash doesn't allow arguments like FileHash[file,{"CRC32","MD5"}]; A solution could be: ...
mitochondrial's user avatar
29 votes
2 answers
1k views

Default behaviour of Hash[expr] and hashing in different versions of Mathematica

In different versions of Mathematica, Wolfram silently changed the behaviour of Hash when the algorithm is not specified explicitly ...
xcah's user avatar
  • 528
15 votes
3 answers
1k views

Why does Hash return different values in Version 7?

This function does not work correctly for me. The generated Gravatars do not match the ones actually produced by using the corresponding address. The problem was traced to differing output from the <...
Mr.Wizard's user avatar
  • 270k