Store hotlink access token hash on upload for short URL lookup.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { createHash } from 'node:crypto';
|
||||
import { hashHotlinkAccessToken } from './hashHotlinkAccessToken';
|
||||
|
||||
describe('hashHotlinkAccessToken', () => {
|
||||
it('matches sha256 hex digest of the utf8 access token string', () => {
|
||||
const accessToken = 'test-hotlink-access-token_base64url';
|
||||
|
||||
expect(hashHotlinkAccessToken(accessToken)).toBe(
|
||||
createHash('sha256').update(accessToken, 'utf8').digest('hex')
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user