Skip to content

Commit

Permalink
Merge branch 'CommanderRoot-rm-deprecated-substr'
Browse files Browse the repository at this point in the history
* CommanderRoot-rm-deprecated-substr:
  fix: replace deprecated String.prototype.substr()
  • Loading branch information
lukekarrys committed Aug 22, 2022
2 parents b30ff50 + d887309 commit 3fbe00e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ var MurmurHash3 = require('imurmurhash')
module.exports = function (uniq) {
if (uniq) {
var hash = new MurmurHash3(uniq)
return ('00000000' + hash.result().toString(16)).substr(-8)
return ('00000000' + hash.result().toString(16)).slice(-8)
} else {
return (Math.random().toString(16) + '0000000').substr(2, 8)
return (Math.random().toString(16) + '0000000').slice(2, 10)
}
}

0 comments on commit 3fbe00e

Please sign in to comment.