mirror of
https://github.com/misenhower/splatoon3.ink.git
synced 2026-04-25 15:36:31 -05:00
Use shorter derived ID values
This commit is contained in:
parent
5a60bdd788
commit
133ed8ce56
|
|
@ -1,4 +1,4 @@
|
|||
import path from 'path';
|
||||
import crypto from 'crypto';
|
||||
|
||||
export function getTopOfCurrentHour(date = null) {
|
||||
date ??= new Date;
|
||||
|
|
@ -22,8 +22,10 @@ export function deriveId(node) {
|
|||
// Unfortunately, SplatNet doesn't return IDs for a lot of gear properties.
|
||||
// Derive IDs from image URLs instead.
|
||||
|
||||
let url = new URL(node.image.url);
|
||||
let id =path.basename(url.pathname, '.png');
|
||||
let url = node.image.url;
|
||||
|
||||
let hash = crypto.createHash('shake256', { outputLength: 8 });
|
||||
let id = hash.update(url).digest('hex');
|
||||
|
||||
return {
|
||||
'__splatoon3ink_id': id,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user