Skip to content
This repository has been archived by the owner on Feb 22, 2019. It is now read-only.

Switch to hash.js from sha1 #67

Merged
merged 2 commits into from
Jul 20, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var debug = require( 'debug' )( 'i18n-calypso' ),
Jed = require( 'jed' ),
moment = require( 'moment-timezone' ),
sha1 = require( 'sha1' ),
sha1 = require( 'hash.js/lib/hash/sha/1' ),
EventEmitter = require( 'events' ).EventEmitter,
interpolateComponents = require( 'interpolate-components' ).default,
LRU = require( 'lru' ),
Expand Down Expand Up @@ -204,7 +204,7 @@ I18N.prototype.setLocale = function( localeData ) {
if ( typeof hashCache[ hashLength + string ] !== 'undefined' ) {
return hashCache[ hashLength + string ];
}
var hash = sha1( string );
var hash = sha1().update( string ).digest('hex');

if ( hashLength ) {
return hashCache[ hashLength + string ] = hash.substr( 0, hashLength );
Expand Down
33 changes: 14 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"create-react-class": "^15.6.2",
"debug": "^3.1.0",
"globby": "^6.1.0",
"hash.js": "^1.1.5",
"interpolate-components": "1.1.1",
"jed": "1.0.2",
"jstimezonedetect": "1.0.5",
Expand All @@ -33,7 +34,6 @@
"lru": "^3.1.0",
"moment-timezone": "0.5.11",
"react": "0.14.8 || ^15.5.0 || ^16.0.0",
"sha1": "^1.1.1",
"xgettext-js": "^2.0.0"
},
"devDependencies": {
Expand Down