Skip to content

Commit

Permalink
Updating hashing algorithm to md5 so we can support node 18 (#33)
Browse files Browse the repository at this point in the history
* Updating hashing algorithm to md5 so we can support node 18

* upgrading nock
  • Loading branch information
pogotc authored Sep 8, 2023
1 parent 52140a7 commit b4a5dfd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ workflows:
- "12.13"
- "14.20"
- "16.17"
- "18.17"

jobs:
build:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "talis-node",
"version": "0.2.0",
"version": "0.2.1",
"description": "",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -31,7 +31,7 @@
"jshint": "2.10.1",
"leche": "2.2.3",
"mocha": "5.2.0",
"nock": "7.2.2",
"nock": "13.3.3",
"nyc": "13.3.0",
"proxyquire": "2.1.0",
"rewire": "2.1.4",
Expand Down
6 changes: 3 additions & 3 deletions persona/client/lib/hash-key.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
var crypto = require('crypto');

/**
* Hash a key using md4 & base64 encoding. Md4 is used as the implementation
* in node is the fastest hashing alg supported.
* Hash a key using md5 & base64 encoding.
*
* @param {string} key value to hash
* @return {string} hashed key
*/
var hashKey = function hashKey(key) {
return crypto
.createHash('md4')
.createHash('md5')
.update(key)
.digest('base64');
};
Expand Down
6 changes: 3 additions & 3 deletions persona/test/unit/hash-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ describe('hash-key', function() {
[
{
key: 'key',
hash: 'v6DpRaPd9vWLlfoxg3ke0Q==',
hash: 'PG4LipwVIkqCKLmpjKFTHQ==',
},
{
key: 'data',
hash: 'U5CAuieM9M9NsuSjJkL/MA=='
hash: 'jXd/OF09/siBXSD3SWAm3A=='
},
{
key: 'www.talis.com',
hash: 'MLXjuG895/5cv8ynX60Yyg=='
hash: '+ndbTPexWjfadqriJyG+vA=='
}
].forEach(function(test) {
hashKey(test.key).should.equal(test.hash);
Expand Down

0 comments on commit b4a5dfd

Please sign in to comment.