Skip to content

Commit

Permalink
chore: use string-timing-safe-equal package
Browse files Browse the repository at this point in the history
This change should have no user impact.

I just published [`string-timing-safe-equal`][0], a package that
replaces our `timingSafeEqual` utility.

I think this is a useful change on its own but will make an upcoming
server change smaller.

[0]: https://www.npmjs.com/package/string-timing-safe-equal
  • Loading branch information
EvanHahn committed Oct 23, 2024
1 parent 7dbed14 commit 19f4758
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 66 deletions.
9 changes: 9 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
"sodium-universal": "^4.0.0",
"start-stop-state-machine": "^1.2.0",
"streamx": "^2.19.0",
"string-timing-safe-equal": "^0.1.0",
"styled-map-package": "^2.0.0",
"sub-encoder": "^2.1.1",
"throttle-debounce": "^5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/invite-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { pEvent } from 'p-event'
import { InviteResponse_Decision } from './generated/rpc.js'
import { assert, keyToId, noop } from './utils.js'
import HashMap from './lib/hashmap.js'
import timingSafeEqual from './lib/timing-safe-equal.js'
import timingSafeEqual from 'string-timing-safe-equal'
import { Logger } from './logger.js'
/** @import { MapBuffers } from './types.js' */
/**
Expand Down
34 changes: 0 additions & 34 deletions src/lib/timing-safe-equal.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/member-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from './utils.js'
import { keyBy } from './lib/key-by.js'
import { abortSignalAny } from './lib/ponyfills.js'
import timingSafeEqual from './lib/timing-safe-equal.js'
import timingSafeEqual from 'string-timing-safe-equal'
import { ROLES, isRoleIdForNewInvite } from './roles.js'
/**
* @import {
Expand Down
30 changes: 0 additions & 30 deletions test/lib/timing-safe-equal.js

This file was deleted.

0 comments on commit 19f4758

Please sign in to comment.