Skip to content

Commit

Permalink
Fixed hash generation for common toponym id legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
antoineludeau committed May 16, 2024
1 parent 4e1ad51 commit 2c53885
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/api/consumers/format-to-legacy-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const formatCommonToponymDataForLegacy = (commonToponym, district, pseudo
legacyCommonToponymId = `${cog}_${pseudoCodeVoieGenerator.getCode(legacyLabelValue, codeAncienneCommune)}`.toLowerCase()
// If the pseudo code is already used, we generate a new one with a hash from the common toponym id
if (commonToponymLegacyIDSet.has(legacyCommonToponymId)) {
legacyCommonToponymId = `${cog}_${createHmac('sha256').update(id).digest('hex').slice(0, 5)}`
legacyCommonToponymId = `${cog}_${createHmac('sha256', 'ban').update(id).digest('hex').slice(0, 5)}`
}
}

Expand Down

0 comments on commit 2c53885

Please sign in to comment.